Skip to content

0.4.5

Latest

Choose a tag to compare

@SergeyShk SergeyShk released this 30 Oct 22:14
c5ca90d

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.5

Fixes

  • blank_lines of the cohesion component. Since 0.4.2 a paragraph of CohesionStats is a line by default, and blank_lines=True takes 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 esTS CohesionStats of 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 CohesionStats pickled by an earlier version of 0.4 has to be computed again: pickled before get_stats, it lacks the overlaps with the next sentences and paragraphs; one of 0.4.2-0.4.4 lacks n_paragraphs as well, and carries the sets of the old version.

Links