Repository navigation
0.4.2
A patch of anyTS with the fixes found by the quality check of ruTS 0.19 on Russian corpora: the definitions of the keys added in 0.4, the check of the parts of speech, and caveats in the cards of the docs. No library has been released on the keys of 0.4 yet, so their definitions change before one is.
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.2Changes of numbers
- Verb phrases of L2SCA. A participle or another non-finite form under
amodoracl, or coordinated to one, without an auxiliary, a copula or a subject of its own is an attribute of its noun, not a verb phrase (the house built by workers), as in L2SCA. On the texts of ruTS by school grade, such participles made all the growth of VP/T with the grade. - Clauses of L2SCA. C/T, CP/C and CN/C divide by the new
n_l2sca_clauses: the clauses without the predicates sharing a subject (took the bucket and went) and without the infinitive clauses, as L2SCA counts finite clauses with a subject. C/S, MLC and the other metrics keep their clauses. - Infinitive clauses. An infinitive clause head under
csubj,advclorccomp(it is hard to say, he came to help) is an infinitive clause, as one underxcomp, not a subordinate one:subordinate_clauses_per_sent,p_complex_sentsandp_complex_t_unitsfall andinfinitive_clauses_per_sentgrows on the texts with such infinitives. - Infinitive under a conjunct of a periphrasis. In ready to come and help you live the clause of live is kept: the walk from it asks
is_infinitive_periphrasisalong the chain of infinitive conjuncts. - Prepositional chains. A nominal predicate with a subject of its own and no copula (the present tense of Russian) starts a chain, like one with a copula.
- Paragraphs are lines, as in TAACO. They were the parts between blank lines, so the corpora with a paragraph on every line gave
nanfor every*_para. A paragraph without content words, such as the number of a chapter, joins the next one, the last such the one before it. - In the snapshot of ruTS, 78 of 4,890 results change, by the rules above alone.
Features
subordinating_marksofSyntaxStats, and the parameter ofis_subordinate_clause_headandis_infinitive_clause_head: the subordinating conjunctions that make a clause underconjorparataxisa subordinate one (an infinitive one with an infinitive), since a model may attach a clause of because as a conjunct. Such a clause is no T-unit, nor is a clause under it, and it starts a coordination of its own. Empty by default.blank_linesofCohesionStats,find_paragraph_startsandfind_unit_paragraph_starts: the paragraphs start after the blank lines alone, for a text whose lines are wrapped inside its paragraphs.LINE_BREAKinanyts.utilsis the pattern of the line breaks.split_paragraphs(the parts ofdispersion) is unchanged.has_pos(doc)inanyts.utils: whether the words of aDoccarry parts of speech.
Fixes
- Parts of speech. The attribute ruler of a pipeline without its morphologizer still tags whitespace
SPACE, sohas_annotation("POS")passed any text with a line break, andSyntaxStats,CohesionStats,MorphStatsand the highlighting went on without parts of speech. They check byhas_pos;no_posasks not to disable the tagger or the morphologizer. get_statsraisesParameterErrorfor aflatthat is not abool(get_stats("n_words")returned the flattened statistics), andMorphStats.get_statsfor afilter_noneor aflatthat is not one.- Docs. Caveats on Orlov's Z (unstable on texts shorter than about ten thousand words), burstiness on short texts, the bias of the entropies of word lengths, Dickes-Steiwer and the length of a text, Strain as 0.3 times Fucks, and the similarity of sentences, which sees no order of words.
Incompatible changes
find_paragraph_starts,find_unit_paragraph_startsandCohesionStatsstart a paragraph after a line break by default;blank_lines=Truekeeps the blank lines.CohesionStats.n_paragraphsis a property and counts the paragraphs with content words.- A
SyntaxStatspickled by 0.4.1 lacks the infinitive clauses kept for L2SCA, and itsget_statsraisesAttributeError: it needs to be computed again. infinitive_clauses_per_sentis described as "Infinitive clauses per sentence".
Links
- Documentation: https://sergeyshk.github.io/anyTS/
- PyPI: https://pypi.org/project/anyts/