spaCy/spacy/tests/training
Daniël de Kok 8d69874afb
Add spacy.PlainTextCorpusReader.v1 (#12122)
* Add `spacy.PlainTextCorpusReader.v1`

This is a corpus reader that reads plain text corpora with the following
format:

- UTF-8 encoding
- One line per document.
- Blank lines are ignored.

It is useful for applications where we deal with very large corpora,
such as distillation, and don't want to deal with the space overhead of
serialized formats. Additionally, many large corpora already use such
a text format, keeping the necessary preprocessing to a minimum.

* Update spacy/training/corpus.py

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>

* docs: add version to `PlainTextCorpus`

* Add docstring to registry function

* Add plain text corpus tests

* Only strip newline/carriage return

* Add return type _string_to_tmp_file helper

* Use a temporary directory in place of file name

Different OS auto delete/sharing semantics are just wonky.

* This will be new in 3.5.1 (rather than 4)

* Test improvements from code review

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
2023-01-26 11:33:22 +01:00
..
__init__.py move tests to correct subdir 2020-09-15 21:40:38 +02:00
test_augmenters.py Preserve missing entity annotation in augmenters (#11540) 2022-09-27 10:16:51 +02:00
test_corpus.py Add spacy.PlainTextCorpusReader.v1 (#12122) 2023-01-26 11:33:22 +01:00
test_logger.py Add ConsoleLogger.v2 (#11214) 2022-08-29 10:23:05 +02:00
test_new_example.py adding spans to doc_annotation in Example.to_dict (#11261) 2022-08-05 12:26:38 +02:00
test_pretraining.py Tagger: use unnormalized probabilities for inference (#10197) 2022-03-15 14:15:31 +01:00
test_readers.py Revert "disable failing test because Stanford servers are down (#11015)" (#11054) 2022-06-30 11:24:54 +02:00
test_rehearse.py bugfix parser labels (#10797) 2022-05-13 11:41:32 +02:00
test_training.py Add training.before_update callback (#11739) 2022-11-23 17:54:58 +01:00