Repository navigation
A patch of anyTS for esTS 0.9, from its quality check: the cohesion component takes blank_lines, and CohesionStats keeps less memory.
Requirements
The same as anyTS 0.4.0: Python 3.11 or newer, spaCy 3.8.15 or newer within 3, preshed 3.0.11 or newer except 3.0.14.
pip install anyts==0.4.5Fixes
blank_linesof the cohesion component. Since 0.4.2 a paragraph ofCohesionStatsis a line by default, andblank_lines=Truetakes the parts between blank lines, which a text wrapped inside its paragraphs needs.CohesionStatsComponent(nlp, name, blank_lines=False)passes it to its class now, so a pipeline can do the same:nlp.add_pipe("<library>_cohesion", config={"blank_lines": True}).- Memory of
CohesionStats. The overlaps with the next two sentences and with the next paragraph were computed on first use, from sets the object kept for every sentence and, in a text wrapped inside its paragraphs, for nearly every word. They are computed when the object is created now, and nothing else is kept: an esTSCohesionStatsof a parsed novel of 44.6 thousand tokens holds about 5 MB instead of 12.8 MB, its pickle 575 KB instead of 1375 KB, in the same time. No number changes.
Incompatible changes
- A
CohesionStatspickled by an earlier version of 0.4 has to be computed again: pickled beforeget_stats, it lacks the overlaps with the next sentences and paragraphs; one of 0.4.2-0.4.4 lacksn_paragraphsas well, and carries the sets of the old version.
Links
- Documentation: https://sergeyshk.github.io/anyTS/
- PyPI: https://pypi.org/project/anyts/