pyests 0.7.0__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyests-0.7.0 → pyests-0.9.0}/PKG-INFO +59 -50
- {pyests-0.7.0 → pyests-0.9.0}/README.es.md +56 -47
- {pyests-0.7.0 → pyests-0.9.0}/README.md +56 -47
- pyests-0.9.0/ests/__init__.py +116 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/basic_stats.py +10 -2
- pyests-0.9.0/ests/cohesion_stats.py +546 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/components.py +105 -139
- {pyests-0.7.0 → pyests-0.9.0}/ests/constants.py +298 -37
- pyests-0.9.0/ests/corpus/__init__.py +115 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/corpus/compare.py +117 -159
- {pyests-0.7.0 → pyests-0.9.0}/ests/corpus/keyness.py +33 -14
- {pyests-0.7.0 → pyests-0.9.0}/ests/corpus/kwic.py +8 -3
- {pyests-0.7.0 → pyests-0.9.0}/ests/corpus/stylometry.py +23 -17
- {pyests-0.7.0 → pyests-0.9.0}/ests/datasets/freq_dict.py +3 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/datasets/spanish_literature.py +3 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/datasets/spanish_sonnets.py +3 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/diversity_stats.py +23 -10
- {pyests-0.7.0 → pyests-0.9.0}/ests/extractors.py +4 -2
- {pyests-0.7.0 → pyests-0.9.0}/ests/lexical_stats.py +100 -186
- pyests-0.9.0/ests/morph_stats.py +262 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/phon_stats.py +61 -170
- {pyests-0.7.0 → pyests-0.9.0}/ests/readability_stats.py +30 -44
- {pyests-0.7.0 → pyests-0.9.0}/ests/resources/README.md +1 -1
- {pyests-0.7.0 → pyests-0.9.0}/ests/resources/connectors.tsv +23 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/style_stats.py +224 -502
- {pyests-0.7.0 → pyests-0.9.0}/ests/syllables.py +1 -1
- {pyests-0.7.0 → pyests-0.9.0}/ests/syntax_stats.py +218 -278
- pyests-0.9.0/ests/unadapted_readability_stats.py +76 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/utils.py +59 -113
- {pyests-0.7.0 → pyests-0.9.0}/ests/verse_stats.py +23 -27
- pyests-0.9.0/ests/visualizers/__init__.py +72 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/highlight.py +321 -148
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/sentences.py +10 -3
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/stylometry.py +3 -0
- {pyests-0.7.0 → pyests-0.9.0}/pyproject.toml +4 -3
- pyests-0.7.0/ests/__init__.py +0 -90
- pyests-0.7.0/ests/cohesion_stats.py +0 -590
- pyests-0.7.0/ests/corpus/__init__.py +0 -65
- pyests-0.7.0/ests/morph_stats.py +0 -402
- pyests-0.7.0/ests/visualizers/__init__.py +0 -29
- {pyests-0.7.0 → pyests-0.9.0}/.gitignore +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/LICENSE.txt +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/corpus/collocations.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/corpus/dispersion.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/datasets/__init__.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/exceptions.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/py.typed +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/resources/google_books_top10000.txt +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/corpus.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/fingerprinting.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/vocabulary.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/word_tree.py +0 -0
- {pyests-0.7.0 → pyests-0.9.0}/ests/visualizers/zipf.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pyests
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: Spanish Texts Statistics
|
|
5
5
|
Project-URL: Homepage, https://github.com/SergeyShk/esTS
|
|
6
6
|
Project-URL: Repository, https://github.com/SergeyShk/esTS
|
|
@@ -28,14 +28,14 @@ Classifier: Topic :: Text Processing
|
|
|
28
28
|
Classifier: Topic :: Text Processing :: Linguistic
|
|
29
29
|
Classifier: Typing :: Typed
|
|
30
30
|
Requires-Python: >=3.11
|
|
31
|
-
Requires-Dist: anyts<0.
|
|
31
|
+
Requires-Dist: anyts<0.5,>=0.4.5
|
|
32
32
|
Requires-Dist: graphviz>=0.20.3
|
|
33
33
|
Requires-Dist: matplotlib>=3.8
|
|
34
34
|
Requires-Dist: numpy>=1.26
|
|
35
35
|
Requires-Dist: pandas>=2.1
|
|
36
36
|
Requires-Dist: scipy>=1.11
|
|
37
37
|
Requires-Dist: simplemma<3,>=2.0
|
|
38
|
-
Requires-Dist: spacy
|
|
38
|
+
Requires-Dist: spacy<4,>=3.8.15
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
40
|
|
|
41
41
|
<p align="center">
|
|
@@ -77,22 +77,22 @@ Description-Content-Type: text/markdown
|
|
|
77
77
|
|
|
78
78
|
The library works both with raw strings and with `Doc` objects of [spaCy](https://github.com/explosion/spaCy); most statistics need no trained model (see Installation). Try it without installing in the [demo on Hugging Face Spaces](https://huggingface.co/spaces/SergeyShk/esTS): paste a text and get its readability, the metrics, the plots and the highlighting of its fragments. The [notebooks](https://sergeyshk.github.io/esTS/examples/) show the library on its datasets - a short story through every tool, prose authors, sonnets and corpus measures; the first one opens in [Colab](https://colab.research.google.com/github/SergeyShk/esTS/blob/master/examples/01_text_walkthrough.ipynb).
|
|
79
79
|
|
|
80
|
-
* **[Object extraction](https://sergeyshk.github.io/esTS/extractors/sentences/)** - configurable sentence, word and character N-gram tokenizers that know the inverted marks, the dialogue dash and the abbreviations of Spanish
|
|
80
|
+
* **[Object extraction](https://sergeyshk.github.io/esTS/extractors/sentences/)** - configurable sentence, word and character N-gram tokenizers that know the inverted marks, the dialogue dash and the abbreviations of Spanish, and the paragraphs of a text
|
|
81
81
|
* **[Syllables and stress](https://sergeyshk.github.io/esTS/syllables/)** - rule-based syllabification and the stressed syllable derived from the spelling, with no dictionary
|
|
82
|
-
* **[Basic statistics](https://sergeyshk.github.io/esTS/stats/basic_stats/)** - counts of sentences, words, letters, syllables and punctuation marks by type, with distributions and
|
|
83
|
-
* **[Readability metrics](https://sergeyshk.github.io/esTS/stats/readability_stats/)** - Fernández Huerta, Szigriszt-Pazos with the INFLESZ scale, Gutiérrez de Polini, Crawford, Legibilidad µ, SOL, LIX and RIX, with a consensus grade, the school stages of Spain and reading time
|
|
84
|
-
* **[Lexical diversity metrics](https://sergeyshk.github.io/esTS/stats/diversity_stats/)** - TTR and its variations, MATTR, MSTTR, MTLD, HD-D, Simpson's and Yule's indices, entropy, Zipf's and Heaps' laws
|
|
82
|
+
* **[Basic statistics](https://sergeyshk.github.io/esTS/stats/basic_stats/)** - counts of sentences, words, letters, syllables and punctuation marks by type, with distributions, normalized shares and the entropies of word lengths
|
|
83
|
+
* **[Readability metrics](https://sergeyshk.github.io/esTS/stats/readability_stats/)** - Fernández Huerta, Szigriszt-Pazos with the INFLESZ scale, Gutiérrez de Polini, Crawford, Legibilidad µ, SOL, LIX and RIX, with a consensus grade, the school stages of Spain and reading time, and formulas of other languages with their own coefficients
|
|
84
|
+
* **[Lexical diversity metrics](https://sergeyshk.github.io/esTS/stats/diversity_stats/)** - TTR and its variations, MATTR, MSTTR, MTLD and MAMTLD, HD-D, Simpson's and Yule's indices, entropy, Orlov's Z, the burstiness of the lexemes, Zipf's and Heaps' laws
|
|
85
85
|
* **[Morphological statistics](https://sergeyshk.github.io/esTS/stats/morph_stats/)** - parts of speech and fifteen grammatical features of Universal Dependencies, with the markers of Spanish: the moods, the non-finite forms, `ser` against `estar`, the adverbs in `-mente`
|
|
86
|
-
* **[Corpus measures](https://sergeyshk.github.io/esTS/corpus/keyness/)** - keywords against a reference corpus, collocations, the dispersion of a word over the parts of a text, a KWIC concordance and the stylometry of authorship: Burrows's Delta with its variants, Zeta, the Mendenhall curve, the profile of the function words; the comparison of two corpora by
|
|
87
|
-
* **[Visualizers](https://sergeyshk.github.io/esTS/visualizers/zipf/)** - Zipf's law, literature fingerprinting, a word tree, lexical dispersion and keywords, a network of collocations, a dendrogram, PCA and MDS by Delta, vocabulary growth, sentence lengths, and the highlighting of the fragments the statistics count, such as long sentences and passives
|
|
86
|
+
* **[Corpus measures](https://sergeyshk.github.io/esTS/corpus/keyness/)** - keywords against a reference corpus, collocations, the dispersion of a word over the parts of a text, a KWIC concordance and the stylometry of authorship: Burrows's Delta with its variants, Zeta, the Mendenhall curve, the profile of the function words; the comparison of two corpora by 163 features of a text with effect sizes
|
|
87
|
+
* **[Visualizers](https://sergeyshk.github.io/esTS/visualizers/zipf/)** - Zipf's law, literature fingerprinting, a word tree, lexical dispersion and keywords, a network of collocations, a dendrogram, PCA and MDS by Delta, the distances within and between authors, rolling Delta and Zeta, vocabulary growth, sentence lengths, and the highlighting of the fragments the statistics count, such as long sentences and passives
|
|
88
88
|
* **[Datasets](https://sergeyshk.github.io/esTS/datasets/spanishliterature/)** - Spanish-language literature in the public domain: 150 works by 33 authors in four genres; 4,259 sonnets of the 15th-20th centuries with the metrical pattern and the rhyme of every line; a frequency dictionary of 83,785 lemmas by Google Books Ngram
|
|
89
89
|
* **[spaCy components](https://sergeyshk.github.io/esTS/components/)** - every statistics class as a component of a pipeline, the statistics attached to the `Doc` in one pass
|
|
90
|
-
* **[Cohesion statistics](https://sergeyshk.github.io/esTS/stats/cohesion_stats/)** - the overlap of nouns, arguments and content words between sentences, givenness and temporal cohesion in the manner of Coh-Metrix, with the density of
|
|
90
|
+
* **[Cohesion statistics](https://sergeyshk.github.io/esTS/stats/cohesion_stats/)** - the overlap of nouns, arguments and content words between sentences, givenness and temporal cohesion in the manner of Coh-Metrix, the overlap with the next sentences and paragraphs of TAACO, with the density of 273 Spanish discourse markers by class and by place
|
|
91
91
|
* **[Lexical sophistication statistics](https://sergeyshk.github.io/esTS/stats/lexical_stats/)** - how rare the words of a text are in the language: the frequency, range and dispersion of the lemmas by a dictionary of Google Books Ngram, the frequency bands top-1000 to 10000, surprisal, perplexity and lexical density
|
|
92
92
|
* **[Style metrics](https://sergeyshk.github.io/esTS/stats/style_stats/)** - the SEO indicators of Advego and Text.ru (nausea, water content, spam score, naturalness by Zipf's law, keyword density) and the markers of the officialese style by the Spanish-language guides to plain language: verbal nouns, compound prepositions, parenthetical expressions and clichés
|
|
93
93
|
* **[Phonostatistics](https://sergeyshk.github.io/esTS/stats/phon_stats/)** - the shares of the classes of sounds, consonant clusters, hiatuses, open syllables, hardness and the indices of alliteration and assonance, over the sounds of a rule-based transcription
|
|
94
94
|
* **[Verse statistics](https://sergeyshk.github.io/esTS/stats/verse_stats/)** - the scansion of Spanish verse by its syllabic meter: the metrical syllables, the meter of a poem, the stress profile and the types of the endecasílabo, the rhyme in full and by assonance with its scheme, the strophes and the form of a poem
|
|
95
|
-
* **[Syntactic statistics](https://sergeyshk.github.io/esTS/stats/syntax_stats/)** - the dependency tree by distances, depth, clauses and coordination, with the constructions of the administrative style: the passive with `ser` and with `se`, the participial and the gerund clauses, the chains of `de`, the split predicates
|
|
95
|
+
* **[Syntactic statistics](https://sergeyshk.github.io/esTS/stats/syntax_stats/)** - the dependency tree by distances, depth, clauses and coordination, the production units of L2SCA, prepositional chains, the order of the subject and the object, the similarity of adjacent sentences, with the constructions of the administrative style: the passive with `ser` and with `se`, the participial and the gerund clauses, the chains of `de`, the split predicates
|
|
96
96
|
|
|
97
97
|
## Installation
|
|
98
98
|
|
|
@@ -139,6 +139,8 @@ The statistics by the frequency dictionary need it downloaded once with `FreqDic
|
|
|
139
139
|
'n_spaces': 9,
|
|
140
140
|
'n_syllables': 23,
|
|
141
141
|
'n_punctuations': 2,
|
|
142
|
+
'letters_entropy': 2.5219280948873624,
|
|
143
|
+
'syllables_entropy': 1.7219280948873623,
|
|
142
144
|
'c_punctuations': {'comma': 1, 'period': 0, 'question': 0, 'exclamation': 0,
|
|
143
145
|
'ellipsis': 0, 'colon': 1, 'semicolon': 0, 'dash': 0,
|
|
144
146
|
'hyphen': 0, 'angle_quotes': 0, 'straight_quotes': 0,
|
|
@@ -155,7 +157,7 @@ The statistics by the frequency dictionary need it downloaded once with `FreqDic
|
|
|
155
157
|
|
|
156
158
|
### Object extraction
|
|
157
159
|
|
|
158
|
-
Configurable tools extract sentences, words and character N-grams from a text for the statistics. The sentence splitter knows the inverted marks, the dialogue dash and the abbreviations of Spanish; the word tokenizer keeps clitics, ordinals and Spanish numbers whole, and lemmas come from [simplemma](https://github.com/adbar/simplemma), which needs no model.
|
|
160
|
+
Configurable tools extract sentences, words and character N-grams from a text for the statistics, and `split_paragraphs` its paragraphs between blank lines. The sentence splitter knows the inverted marks, the dialogue dash and the abbreviations of Spanish; the word tokenizer keeps clitics, ordinals and Spanish numbers whole, and lemmas come from [simplemma](https://github.com/adbar/simplemma), which needs no model.
|
|
159
161
|
|
|
160
162
|
```python
|
|
161
163
|
>>> from ests import CharNgramsExtractor, SentsExtractor, WordsExtractor
|
|
@@ -178,7 +180,7 @@ More in the [documentation](https://sergeyshk.github.io/esTS/extractors/sentence
|
|
|
178
180
|
|
|
179
181
|
<br>
|
|
180
182
|
|
|
181
|
-
The syllables and the stress follow from the Spanish spelling, with no dictionary: the written accent, or the ending of the word when there is none, gives the stressed syllable. Adverbs in `-mente` and hyphenated compounds
|
|
183
|
+
The syllables and the stress follow from the Spanish spelling, with no dictionary: the written accent, or the ending of the word when there is none, gives the stressed syllable. Adverbs in `-mente` carry two stresses, and hyphenated compounds one per part.
|
|
182
184
|
|
|
183
185
|
```python
|
|
184
186
|
>>> from ests.syllables import stress_type, syllabify, word_stress, word_stresses
|
|
@@ -222,6 +224,7 @@ The library allows extracting the following statistics from a text:
|
|
|
222
224
|
* the number of punctuation marks and their distribution by type
|
|
223
225
|
* the distribution of words by the number of letters
|
|
224
226
|
* the distribution of words by the number of syllables
|
|
227
|
+
* the entropy of word lengths in letters and in syllables
|
|
225
228
|
|
|
226
229
|
A complex word has three or more syllables and a long word seven or more letters. Any statistic can be printed in a readable form:
|
|
227
230
|
|
|
@@ -230,21 +233,23 @@ A complex word has three or more syllables and a long word seven or more letters
|
|
|
230
233
|
|
|
231
234
|
>>> text = "Hay tres clases de mentiras: mentiras, malditas mentiras y estadísticas"
|
|
232
235
|
>>> BasicStats(text).print_stats()
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
Sentences
|
|
236
|
-
Words
|
|
237
|
-
Unique words
|
|
238
|
-
Long words
|
|
239
|
-
Complex words
|
|
240
|
-
Simple words
|
|
241
|
-
Monosyllabic words
|
|
242
|
-
Polysyllabic words
|
|
243
|
-
Characters
|
|
244
|
-
Letters
|
|
245
|
-
Spaces
|
|
246
|
-
Syllables
|
|
247
|
-
Punctuation marks
|
|
236
|
+
Statistic | Value
|
|
237
|
+
-----------------------------------------------------------
|
|
238
|
+
Sentences | 1
|
|
239
|
+
Words | 10
|
|
240
|
+
Unique words | 8
|
|
241
|
+
Long words | 5
|
|
242
|
+
Complex words | 5
|
|
243
|
+
Simple words | 5
|
|
244
|
+
Monosyllabic words | 4
|
|
245
|
+
Polysyllabic words | 6
|
|
246
|
+
Characters | 71
|
|
247
|
+
Letters | 60
|
|
248
|
+
Spaces | 9
|
|
249
|
+
Syllables | 23
|
|
250
|
+
Punctuation marks | 2
|
|
251
|
+
Entropy of the word lengths in letters (bits) | 2.52
|
|
252
|
+
Entropy of the word lengths in syllables (bits) | 1.72
|
|
248
253
|
```
|
|
249
254
|
|
|
250
255
|
More in the [documentation](https://sergeyshk.github.io/esTS/stats/basic_stats/).
|
|
@@ -265,6 +270,7 @@ The library allows counting the following readability metrics:
|
|
|
265
270
|
* SOL grade, the SMOG index converted to Spanish
|
|
266
271
|
* LIX readability measure
|
|
267
272
|
* RIX readability measure
|
|
273
|
+
* [Formulas of other languages](https://sergeyshk.github.io/esTS/stats/unadapted_readability_stats/) (`UnadaptedReadabilityStats`): FORCAST, Linsear Write, Wiener Sachtextformel, Gulpease and others with their own coefficients, with no calibration for Spanish - to compare texts with each other and with other tools, not for a Spanish grade
|
|
268
274
|
|
|
269
275
|
On top of the formulas: the band of a scale for the reading ease, Legibilidad µ and LIX, the reading of any metric, a consensus grade (the median of the grade formulas), the school stage and the reader age in Spain, and reading time.
|
|
270
276
|
|
|
@@ -289,17 +295,17 @@ The coefficients of the Flesch reading ease are selected by `preset`: by default
|
|
|
289
295
|
'reading_time': 0.03597122302158273}
|
|
290
296
|
|
|
291
297
|
>>> rs.print_stats()
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
Flesch reading ease (Szigriszt-Pazos)
|
|
295
|
-
Gutiérrez de Polini comprehensibility
|
|
296
|
-
Crawford grade
|
|
297
|
-
Legibilidad µ
|
|
298
|
-
SOL grade (SMOG for Spanish)
|
|
299
|
-
LIX readability index
|
|
300
|
-
RIX readability index
|
|
301
|
-
Consensus grade
|
|
302
|
-
Reading time (min)
|
|
298
|
+
Metric | Value
|
|
299
|
+
-------------------------------------------------
|
|
300
|
+
Flesch reading ease (Szigriszt-Pazos) | 53.55
|
|
301
|
+
Gutiérrez de Polini comprehensibility | 33.50
|
|
302
|
+
Crawford grade | 5.81
|
|
303
|
+
Legibilidad µ | 50.94
|
|
304
|
+
SOL grade (SMOG for Spanish) | 9.26
|
|
305
|
+
LIX readability index | 60.00
|
|
306
|
+
RIX readability index | 5.00
|
|
307
|
+
Consensus grade | 9.00
|
|
308
|
+
Reading time (min) | 0.04
|
|
303
309
|
|
|
304
310
|
>>> rs.describe_level()
|
|
305
311
|
'algo difícil'
|
|
@@ -320,7 +326,7 @@ More in the [documentation](https://sergeyshk.github.io/esTS/stats/readability_s
|
|
|
320
326
|
|
|
321
327
|
<br>
|
|
322
328
|
|
|
323
|
-
The library allows counting
|
|
329
|
+
The library allows counting 34 lexical diversity metrics, among them:
|
|
324
330
|
|
|
325
331
|
* Type-Token Ratio and its variations: RTTR, CTTR, Herdan, Summer, Maas, Dugast
|
|
326
332
|
* Moving Average Type-Token Ratio and Mean Segmental Type-Token Ratio
|
|
@@ -330,6 +336,7 @@ The library allows counting 32 lexical diversity metrics, among them:
|
|
|
330
336
|
* the hapax index (Honoré's R), the measures of Yule, Herdan, Sichel, Michéa, Brunet, Dugast and Baayen
|
|
331
337
|
* Shannon entropy, evenness and perplexity
|
|
332
338
|
* the slope of Zipf's law, the Zipf-Mandelbrot fit and the exponent of Heaps' law
|
|
339
|
+
* Orlov's Z and the burstiness of frequent lexemes
|
|
333
340
|
|
|
334
341
|
Any metric can be computed over windows of equal length, to compare texts of different lengths, with a confidence interval of the mean.
|
|
335
342
|
|
|
@@ -398,7 +405,8 @@ More in the [documentation](https://sergeyshk.github.io/esTS/stats/morph_stats/)
|
|
|
398
405
|
|
|
399
406
|
The dependency tree of Universal Dependencies and the constructions that the Spanish-language guides to plain language warn about:
|
|
400
407
|
|
|
401
|
-
* the complexity of the tree: dependency distances, depth, leaves and subtrees, valency of the finite verbs, coordination chains, clauses and
|
|
408
|
+
* the complexity of the tree: dependency distances, depth, leaves and subtrees, valency of the finite verbs, coordination chains, clauses, subordinate and infinitive clauses, the L2SCA indices by T-units, modifiers per noun, prepositional chains
|
|
409
|
+
* the order and the similarity: words before the root of a sentence, preverbal subjects and objects, the syntactic similarity of adjacent sentences
|
|
402
410
|
* the constructions: the passive with `ser` and with `se`, the participial and the gerund clauses, the chains of `de`, the split predicates, the impersonal `se`, the words of negation, the ratio of nouns to verbs
|
|
403
411
|
|
|
404
412
|
```python
|
|
@@ -434,10 +442,10 @@ More in the [documentation](https://sergeyshk.github.io/esTS/stats/syntax_stats/
|
|
|
434
442
|
|
|
435
443
|
Referential cohesion in the manner of Coh-Metrix and its Spanish adaptation Coh-Metrix-Esp:
|
|
436
444
|
|
|
437
|
-
* the overlap of nouns, of arguments and of content words between adjacent sentences and between all pairs of sentences, binary and proportional
|
|
445
|
+
* the overlap of nouns, of arguments and of content words between adjacent sentences and between all pairs of sentences, binary and proportional, with the next two sentences and between paragraphs (as in TAACO)
|
|
438
446
|
* givenness: pronouns, demonstratives and the content words whose lemma was already used
|
|
439
447
|
* temporal cohesion: the repetition of the tense and of the mood of the verbs of adjacent sentences
|
|
440
|
-
* the density of
|
|
448
|
+
* the density of 273 Spanish discourse markers by class - causal, adversative, concessive, temporal, additive, conditional, reformulative - by kind and by place: linking a sentence to the ones before or the parts of a sentence
|
|
441
449
|
|
|
442
450
|
```python
|
|
443
451
|
>>> from ests import CohesionStats
|
|
@@ -577,7 +585,7 @@ Every statistics class is also a component of a pipeline, so a text is annotated
|
|
|
577
585
|
(12, ('DET', 'NOUN'), 2.0)
|
|
578
586
|
```
|
|
579
587
|
|
|
580
|
-
The factories are `ests_basic`, `ests_readability`, `ests_diversity`, `ests_morph`, `ests_syntax`, `ests_cohesion`, `ests_lexical`, `ests_style`, `ests_phon` and `ests_verse`; the name of the pipe is the name of the extension. The component `ests_blank_lines`, before the parser, starts a sentence after a blank line, as the string API does; the pipeline of `ests.utils.get_nlp` has it.
|
|
588
|
+
The factories are `ests_basic`, `ests_readability`, `ests_unadapted_readability`, `ests_diversity`, `ests_morph`, `ests_syntax`, `ests_cohesion`, `ests_lexical`, `ests_style`, `ests_phon` and `ests_verse`; the name of the pipe is the name of the extension. The component `ests_blank_lines`, before the parser, starts a sentence after a blank line, as the string API does; the pipeline of `ests.utils.get_nlp` has it.
|
|
581
589
|
|
|
582
590
|
More in the [documentation](https://sergeyshk.github.io/esTS/components/).
|
|
583
591
|
|
|
@@ -590,12 +598,12 @@ More in the [documentation](https://sergeyshk.github.io/esTS/components/).
|
|
|
590
598
|
|
|
591
599
|
The measures of corpus linguistics that compare corpora and describe the use of a word:
|
|
592
600
|
|
|
593
|
-
* keywords of a target corpus against a reference one or against the frequency dictionary of Google Books Ngram: the log-likelihood with its p-value, Log Ratio, chi-square, %DIFF, BIC, ELL and the odds ratio
|
|
594
|
-
* collocations by logDice, MI, MI³, t-score, Dice, log-likelihood, NPMI and minimum sensitivity
|
|
601
|
+
* keywords of a target corpus against a reference one or against the frequency dictionary of Google Books Ngram: the log-likelihood with its p-value, Log Ratio, chi-square, %DIFF, BIC, ELL and the odds ratio; by words or n-grams
|
|
602
|
+
* collocations by logDice, MI, MI³, t-score, Dice, log-likelihood, NPMI and minimum sensitivity; the collocates of a word on its left or right
|
|
595
603
|
* the dispersion of a word over the parts of a text: DP of Gries, normalized DP, Juilland's D, Carroll's D2, Rosengren's S and the Kullback-Leibler divergence
|
|
596
604
|
* a KWIC concordance by word form or by lemma
|
|
597
|
-
* stylometry: the distances between texts by Burrows's Delta and its variants, with the attribution of a text to reference authors, the markers of preferred and avoided words by Zeta, Kilgarriff's chi-square, the Mendenhall curve and the profile of the function words
|
|
598
|
-
* the comparison of two corpora by
|
|
605
|
+
* stylometry: the distances between texts by Burrows's Delta and its variants, with the attribution of a text to reference authors and rolling Delta along a text, the markers of preferred and avoided words by Zeta and their shares in segments, Kilgarriff's chi-square, the Mendenhall curve and the profile of the function words
|
|
606
|
+
* the comparison of two corpora by 163 features of a text over windows of the same size: Cliff's delta, Cohen's d and the AUC of every feature, the Mann-Whitney test with Holm's correction and a bootstrap interval of the difference of the medians
|
|
599
607
|
|
|
600
608
|
```python
|
|
601
609
|
>>> from ests import WordsExtractor
|
|
@@ -666,7 +674,7 @@ More in the [documentation](https://sergeyshk.github.io/esTS/datasets/spanishlit
|
|
|
666
674
|
* [Literature fingerprinting](https://sergeyshk.github.io/esTS/visualizers/fingerprinting/)
|
|
667
675
|
* [Word tree](https://sergeyshk.github.io/esTS/visualizers/word_tree/)
|
|
668
676
|
* [Corpus plots](https://sergeyshk.github.io/esTS/visualizers/corpus/): lexical dispersion, a chart of keywords, a network of collocations
|
|
669
|
-
* [Stylometric plots](https://sergeyshk.github.io/esTS/visualizers/stylometry/): a dendrogram, the principal components and the multidimensional scaling by Delta, the Mendenhall curves
|
|
677
|
+
* [Stylometric plots](https://sergeyshk.github.io/esTS/visualizers/stylometry/): a dendrogram, the principal components and the multidimensional scaling by Delta, the histograms of the distances within and between authors, rolling Delta, the segments by the markers of Zeta, the Mendenhall curves
|
|
670
678
|
* [Vocabulary growth and frequency spectrum](https://sergeyshk.github.io/esTS/visualizers/vocabulary/), [sentence lengths](https://sergeyshk.github.io/esTS/visualizers/sentences/) with a moving average
|
|
671
679
|
|
|
672
680
|
The matplotlib plots take the axes `ax` and return `Axes`; the network of collocations and the word tree are rendered by the executables of Graphviz. Cosine Delta separates three novels by Galdós from three by Unamuno:
|
|
@@ -758,9 +766,10 @@ Bug reports, ideas and pull requests are welcome in the [issues](https://github.
|
|
|
758
766
|
* constants.py - constants of the Spanish language and of the metrics
|
|
759
767
|
* diversity_stats.py - lexical diversity metrics of the anyTS core over a string or a Doc
|
|
760
768
|
* exceptions.py - library exceptions
|
|
761
|
-
* extractors.py - the extractors of the anyTS core with the Spanish tokenizers
|
|
769
|
+
* extractors.py - the extractors of the anyTS core with the Spanish tokenizers, the paragraphs of a text
|
|
762
770
|
* morph_stats.py - morphological statistics
|
|
763
771
|
* readability_stats.py - readability metrics: the Spanish formulas over those of the anyTS core
|
|
772
|
+
* unadapted_readability_stats.py - readability formulas of other languages
|
|
764
773
|
* style_stats.py - style metrics
|
|
765
774
|
* phon_stats.py - phonostatistics
|
|
766
775
|
* syntax_stats.py - syntactic statistics
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
|
|
38
38
|
La biblioteca trabaja tanto con cadenas como con objetos `Doc` de [spaCy](https://github.com/explosion/spaCy); la mayoría de las estadísticas no necesita un modelo entrenado (véase Instalación). Se puede probar sin instalar en la [demo en Hugging Face Spaces](https://huggingface.co/spaces/SergeyShk/esTS): pegue un texto y obtenga su legibilidad, las métricas, los gráficos y el resaltado de sus fragmentos. Los [cuadernos](https://sergeyshk.github.io/esTS/es/examples/) muestran la biblioteca sobre sus conjuntos de datos - un cuento analizado con todas las herramientas, los prosistas, los sonetos y las medidas de corpus; el primero se abre en [Colab](https://colab.research.google.com/github/SergeyShk/esTS/blob/master/examples/01_text_walkthrough.ipynb).
|
|
39
39
|
|
|
40
|
-
* **[Extracción de objetos](https://sergeyshk.github.io/esTS/es/extractors/sentences/)** - tokenizadores configurables de oraciones, palabras y N-gramas de caracteres que conocen los signos de apertura, la raya de diálogo y las abreviaturas del español
|
|
40
|
+
* **[Extracción de objetos](https://sergeyshk.github.io/esTS/es/extractors/sentences/)** - tokenizadores configurables de oraciones, palabras y N-gramas de caracteres que conocen los signos de apertura, la raya de diálogo y las abreviaturas del español, y los párrafos de un texto
|
|
41
41
|
* **[Sílabas y acento](https://sergeyshk.github.io/esTS/es/syllables/)** - silabificación por reglas y sílaba tónica deducida de la escritura, sin diccionario
|
|
42
|
-
* **[Estadísticas básicas](https://sergeyshk.github.io/esTS/es/stats/basic_stats/)** - recuentos de oraciones, palabras, letras, sílabas y signos de puntuación por tipo, con distribuciones y
|
|
43
|
-
* **[Métricas de legibilidad](https://sergeyshk.github.io/esTS/es/stats/readability_stats/)** - Fernández Huerta, Szigriszt-Pazos con la escala INFLESZ, Gutiérrez de Polini, Crawford, Legibilidad µ, SOL, LIX y RIX, con grado de consenso, etapas escolares de España y tiempo de lectura
|
|
44
|
-
* **[Métricas de diversidad léxica](https://sergeyshk.github.io/esTS/es/stats/diversity_stats/)** - TTR y sus variantes, MATTR, MSTTR, MTLD, HD-D, índices de Simpson y de Yule, entropía, leyes de Zipf y de Heaps
|
|
42
|
+
* **[Estadísticas básicas](https://sergeyshk.github.io/esTS/es/stats/basic_stats/)** - recuentos de oraciones, palabras, letras, sílabas y signos de puntuación por tipo, con distribuciones, proporciones normalizadas y las entropías de las longitudes de las palabras
|
|
43
|
+
* **[Métricas de legibilidad](https://sergeyshk.github.io/esTS/es/stats/readability_stats/)** - Fernández Huerta, Szigriszt-Pazos con la escala INFLESZ, Gutiérrez de Polini, Crawford, Legibilidad µ, SOL, LIX y RIX, con grado de consenso, etapas escolares de España y tiempo de lectura, y fórmulas de otros idiomas con sus propios coeficientes
|
|
44
|
+
* **[Métricas de diversidad léxica](https://sergeyshk.github.io/esTS/es/stats/diversity_stats/)** - TTR y sus variantes, MATTR, MSTTR, MTLD y MAMTLD, HD-D, índices de Simpson y de Yule, entropía, la Z de Orlov, las ráfagas de los lexemas, leyes de Zipf y de Heaps
|
|
45
45
|
* **[Estadísticas morfológicas](https://sergeyshk.github.io/esTS/es/stats/morph_stats/)** - categorías gramaticales y quince rasgos morfológicos de Universal Dependencies, con los marcadores del español: los modos, las formas no personales, `ser` frente a `estar`, los adverbios en `-mente`
|
|
46
|
-
* **[Medidas de corpus](https://sergeyshk.github.io/esTS/es/corpus/keyness/)** - palabras clave frente a un corpus de referencia, colocaciones, la dispersión de una palabra por las partes de un texto, una concordancia KWIC y la estilometría de autoría: la Delta de Burrows con sus variantes, Zeta, la curva de Mendenhall, el perfil de las palabras funcionales; la comparación de dos corpus por
|
|
47
|
-
* **[Visualizaciones](https://sergeyshk.github.io/esTS/es/visualizers/zipf/)** - ley de Zipf, huella literaria, árbol de palabras, dispersión léxica y palabras clave, red de colocaciones, dendrograma, PCA y MDS por la Delta, crecimiento del vocabulario, longitudes de las oraciones y el resaltado de los fragmentos que cuentan las estadísticas, como las oraciones largas y las pasivas
|
|
46
|
+
* **[Medidas de corpus](https://sergeyshk.github.io/esTS/es/corpus/keyness/)** - palabras clave frente a un corpus de referencia, colocaciones, la dispersión de una palabra por las partes de un texto, una concordancia KWIC y la estilometría de autoría: la Delta de Burrows con sus variantes, Zeta, la curva de Mendenhall, el perfil de las palabras funcionales; la comparación de dos corpus por 163 rasgos de un texto con tamaños del efecto
|
|
47
|
+
* **[Visualizaciones](https://sergeyshk.github.io/esTS/es/visualizers/zipf/)** - ley de Zipf, huella literaria, árbol de palabras, dispersión léxica y palabras clave, red de colocaciones, dendrograma, PCA y MDS por la Delta, las distancias dentro de los autores y entre ellos, la Delta móvil y Zeta, crecimiento del vocabulario, longitudes de las oraciones y el resaltado de los fragmentos que cuentan las estadísticas, como las oraciones largas y las pasivas
|
|
48
48
|
* **[Conjuntos de datos](https://sergeyshk.github.io/esTS/es/datasets/spanishliterature/)** - literatura en español de dominio público: 150 obras de 33 autores en cuatro géneros; 4259 sonetos de los siglos XV-XX con el patrón métrico y la rima de cada verso; un diccionario de frecuencias de 83 785 lemas según Google Books Ngram
|
|
49
49
|
* **[Componentes de spaCy](https://sergeyshk.github.io/esTS/es/components/)** - cada clase de estadísticas como componente de un pipeline, con las estadísticas puestas en el `Doc` en una sola pasada
|
|
50
|
-
* **[Estadísticas de cohesión](https://sergeyshk.github.io/esTS/es/stats/cohesion_stats/)** - la repetición de sustantivos, argumentos y palabras con contenido entre oraciones, la información dada y la cohesión temporal a la manera de Coh-Metrix, con la densidad de
|
|
50
|
+
* **[Estadísticas de cohesión](https://sergeyshk.github.io/esTS/es/stats/cohesion_stats/)** - la repetición de sustantivos, argumentos y palabras con contenido entre oraciones, la información dada y la cohesión temporal a la manera de Coh-Metrix, la repetición en las oraciones siguientes y entre párrafos de TAACO, con la densidad de 273 marcadores del discurso españoles por clase y por lugar
|
|
51
51
|
* **[Estadísticas de complejidad léxica](https://sergeyshk.github.io/esTS/es/stats/lexical_stats/)** - cuán raras son las palabras de un texto en la lengua: la frecuencia, el rango y la dispersión de los lemas según un diccionario de Google Books Ngram, las bandas de frecuencia del top-1000 al 10000, la sorpresa, la perplejidad y la densidad léxica
|
|
52
52
|
* **[Métricas de estilo](https://sergeyshk.github.io/esTS/es/stats/style_stats/)** - los indicadores SEO de Advego y Text.ru (náusea, contenido de agua, índice de spam, naturalidad según Zipf, densidad de palabras clave) y los marcadores del estilo burocrático según las guías de lenguaje claro en español: sustantivos deverbales, locuciones prepositivas, expresiones parentéticas y clichés
|
|
53
53
|
* **[Fonoestadística](https://sergeyshk.github.io/esTS/es/stats/phon_stats/)** - proporciones de las clases de sonidos, grupos consonánticos, hiatos, sílabas abiertas, dureza e índices de aliteración y de asonancia, sobre los sonidos de una transcripción por reglas
|
|
54
54
|
* **[Estadísticas del verso](https://sergeyshk.github.io/esTS/es/stats/verse_stats/)** - la escansión del verso español por su metro silábico: las sílabas métricas, el metro de un poema, el perfil acentual y los tipos del endecasílabo, la rima consonante y asonante con su esquema, las estrofas y la forma de un poema
|
|
55
|
-
* **[Estadísticas sintácticas](https://sergeyshk.github.io/esTS/es/stats/syntax_stats/)** - el árbol de dependencias por distancias, profundidad, cláusulas y coordinación, con las construcciones del estilo administrativo: la pasiva con `ser` y con `se`, las cláusulas de participio y de gerundio, las cadenas de `de`, los predicados escindidos
|
|
55
|
+
* **[Estadísticas sintácticas](https://sergeyshk.github.io/esTS/es/stats/syntax_stats/)** - el árbol de dependencias por distancias, profundidad, cláusulas y coordinación, las unidades de producción de L2SCA, las cadenas preposicionales, el orden del sujeto y del objeto, la semejanza de las oraciones contiguas, con las construcciones del estilo administrativo: la pasiva con `ser` y con `se`, las cláusulas de participio y de gerundio, las cadenas de `de`, los predicados escindidos
|
|
56
56
|
|
|
57
57
|
## Instalación
|
|
58
58
|
|
|
@@ -99,6 +99,8 @@ Las estadísticas según el diccionario de frecuencias lo necesitan descargado u
|
|
|
99
99
|
'n_spaces': 9,
|
|
100
100
|
'n_syllables': 23,
|
|
101
101
|
'n_punctuations': 2,
|
|
102
|
+
'letters_entropy': 2.5219280948873624,
|
|
103
|
+
'syllables_entropy': 1.7219280948873623,
|
|
102
104
|
'c_punctuations': {'comma': 1, 'period': 0, 'question': 0, 'exclamation': 0,
|
|
103
105
|
'ellipsis': 0, 'colon': 1, 'semicolon': 0, 'dash': 0,
|
|
104
106
|
'hyphen': 0, 'angle_quotes': 0, 'straight_quotes': 0,
|
|
@@ -115,7 +117,7 @@ Las estadísticas según el diccionario de frecuencias lo necesitan descargado u
|
|
|
115
117
|
|
|
116
118
|
### Extracción de objetos
|
|
117
119
|
|
|
118
|
-
Herramientas configurables extraen de un texto las oraciones, las palabras y los N-gramas de caracteres para las estadísticas. El segmentador de oraciones conoce los signos de apertura, la raya de diálogo y las abreviaturas del español; el tokenizador de palabras mantiene enteros los clíticos, los ordinales y los números escritos a la española, y los lemas vienen de [simplemma](https://github.com/adbar/simplemma), que no necesita modelo.
|
|
120
|
+
Herramientas configurables extraen de un texto las oraciones, las palabras y los N-gramas de caracteres para las estadísticas, y `split_paragraphs` sus párrafos entre líneas en blanco. El segmentador de oraciones conoce los signos de apertura, la raya de diálogo y las abreviaturas del español; el tokenizador de palabras mantiene enteros los clíticos, los ordinales y los números escritos a la española, y los lemas vienen de [simplemma](https://github.com/adbar/simplemma), que no necesita modelo.
|
|
119
121
|
|
|
120
122
|
```python
|
|
121
123
|
>>> from ests import CharNgramsExtractor, SentsExtractor, WordsExtractor
|
|
@@ -138,7 +140,7 @@ Más en la [documentación](https://sergeyshk.github.io/esTS/es/extractors/sente
|
|
|
138
140
|
|
|
139
141
|
<br>
|
|
140
142
|
|
|
141
|
-
Las sílabas y el acento se deducen de la ortografía española, sin diccionario: la tilde, o la terminación de la palabra cuando no la hay, da la sílaba tónica. Los adverbios en `-mente` y los compuestos con guion
|
|
143
|
+
Las sílabas y el acento se deducen de la ortografía española, sin diccionario: la tilde, o la terminación de la palabra cuando no la hay, da la sílaba tónica. Los adverbios en `-mente` llevan dos acentos, y los compuestos con guion uno por parte.
|
|
142
144
|
|
|
143
145
|
```python
|
|
144
146
|
>>> from ests.syllables import stress_type, syllabify, word_stress, word_stresses
|
|
@@ -182,6 +184,7 @@ La biblioteca permite extraer de un texto las siguientes estadísticas:
|
|
|
182
184
|
* el número de signos de puntuación y su distribución por tipo
|
|
183
185
|
* la distribución de las palabras por número de letras
|
|
184
186
|
* la distribución de las palabras por número de sílabas
|
|
187
|
+
* la entropía de las longitudes de las palabras en letras y en sílabas
|
|
185
188
|
|
|
186
189
|
Una palabra compleja tiene tres o más sílabas y una palabra larga siete o más letras. Cualquier estadística puede mostrarse en forma legible:
|
|
187
190
|
|
|
@@ -190,21 +193,23 @@ Una palabra compleja tiene tres o más sílabas y una palabra larga siete o más
|
|
|
190
193
|
|
|
191
194
|
>>> text = "Hay tres clases de mentiras: mentiras, malditas mentiras y estadísticas"
|
|
192
195
|
>>> BasicStats(text).print_stats()
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
Sentences
|
|
196
|
-
Words
|
|
197
|
-
Unique words
|
|
198
|
-
Long words
|
|
199
|
-
Complex words
|
|
200
|
-
Simple words
|
|
201
|
-
Monosyllabic words
|
|
202
|
-
Polysyllabic words
|
|
203
|
-
Characters
|
|
204
|
-
Letters
|
|
205
|
-
Spaces
|
|
206
|
-
Syllables
|
|
207
|
-
Punctuation marks
|
|
196
|
+
Statistic | Value
|
|
197
|
+
-----------------------------------------------------------
|
|
198
|
+
Sentences | 1
|
|
199
|
+
Words | 10
|
|
200
|
+
Unique words | 8
|
|
201
|
+
Long words | 5
|
|
202
|
+
Complex words | 5
|
|
203
|
+
Simple words | 5
|
|
204
|
+
Monosyllabic words | 4
|
|
205
|
+
Polysyllabic words | 6
|
|
206
|
+
Characters | 71
|
|
207
|
+
Letters | 60
|
|
208
|
+
Spaces | 9
|
|
209
|
+
Syllables | 23
|
|
210
|
+
Punctuation marks | 2
|
|
211
|
+
Entropy of the word lengths in letters (bits) | 2.52
|
|
212
|
+
Entropy of the word lengths in syllables (bits) | 1.72
|
|
208
213
|
```
|
|
209
214
|
|
|
210
215
|
Más en la [documentación](https://sergeyshk.github.io/esTS/es/stats/basic_stats/).
|
|
@@ -225,6 +230,7 @@ La biblioteca permite calcular las siguientes métricas de legibilidad:
|
|
|
225
230
|
* grado SOL, el índice SMOG convertido al español
|
|
226
231
|
* índice de legibilidad LIX
|
|
227
232
|
* índice de legibilidad RIX
|
|
233
|
+
* [Fórmulas de otros idiomas](https://sergeyshk.github.io/esTS/es/stats/unadapted_readability_stats/) (`UnadaptedReadabilityStats`): FORCAST, Linsear Write, Wiener Sachtextformel, Gulpease y otras con sus propios coeficientes, sin calibración para el español: para comparar textos entre sí y con otras herramientas, no para un grado del español
|
|
228
234
|
|
|
229
235
|
Sobre las fórmulas: el nivel de una escala para la facilidad de lectura, la Legibilidad µ y LIX, la lectura de cualquier métrica, un grado de consenso (la mediana de las fórmulas de grado), la etapa escolar y la edad del lector en España, y el tiempo de lectura.
|
|
230
236
|
|
|
@@ -249,17 +255,17 @@ Los coeficientes de la facilidad de lectura de Flesch se eligen con `preset`: po
|
|
|
249
255
|
'reading_time': 0.03597122302158273}
|
|
250
256
|
|
|
251
257
|
>>> rs.print_stats()
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
Flesch reading ease (Szigriszt-Pazos)
|
|
255
|
-
Gutiérrez de Polini comprehensibility
|
|
256
|
-
Crawford grade
|
|
257
|
-
Legibilidad µ
|
|
258
|
-
SOL grade (SMOG for Spanish)
|
|
259
|
-
LIX readability index
|
|
260
|
-
RIX readability index
|
|
261
|
-
Consensus grade
|
|
262
|
-
Reading time (min)
|
|
258
|
+
Metric | Value
|
|
259
|
+
-------------------------------------------------
|
|
260
|
+
Flesch reading ease (Szigriszt-Pazos) | 53.55
|
|
261
|
+
Gutiérrez de Polini comprehensibility | 33.50
|
|
262
|
+
Crawford grade | 5.81
|
|
263
|
+
Legibilidad µ | 50.94
|
|
264
|
+
SOL grade (SMOG for Spanish) | 9.26
|
|
265
|
+
LIX readability index | 60.00
|
|
266
|
+
RIX readability index | 5.00
|
|
267
|
+
Consensus grade | 9.00
|
|
268
|
+
Reading time (min) | 0.04
|
|
263
269
|
|
|
264
270
|
>>> rs.describe_level()
|
|
265
271
|
'algo difícil'
|
|
@@ -280,7 +286,7 @@ Más en la [documentación](https://sergeyshk.github.io/esTS/es/stats/readabilit
|
|
|
280
286
|
|
|
281
287
|
<br>
|
|
282
288
|
|
|
283
|
-
La biblioteca permite calcular
|
|
289
|
+
La biblioteca permite calcular 34 métricas de diversidad léxica, entre ellas:
|
|
284
290
|
|
|
285
291
|
* Type-Token Ratio y sus variantes: RTTR, CTTR, Herdan, Summer, Maas, Dugast
|
|
286
292
|
* Moving Average Type-Token Ratio y Mean Segmental Type-Token Ratio
|
|
@@ -290,6 +296,7 @@ La biblioteca permite calcular 32 métricas de diversidad léxica, entre ellas:
|
|
|
290
296
|
* el índice de hápax (R de Honoré) y las medidas de Yule, Herdan, Sichel, Michéa, Brunet, Dugast y Baayen
|
|
291
297
|
* entropía de Shannon, equitatividad y perplejidad
|
|
292
298
|
* la pendiente de la ley de Zipf, el ajuste de Zipf-Mandelbrot y el exponente de la ley de Heaps
|
|
299
|
+
* la Z de Orlov y el índice de ráfagas (burstiness) de los lexemas frecuentes
|
|
293
300
|
|
|
294
301
|
Cualquier métrica puede calcularse por ventanas de igual longitud, para comparar textos de distinta extensión, con un intervalo de confianza de la media.
|
|
295
302
|
|
|
@@ -358,7 +365,8 @@ Más en la [documentación](https://sergeyshk.github.io/esTS/es/stats/morph_stat
|
|
|
358
365
|
|
|
359
366
|
El árbol de dependencias de Universal Dependencies y las construcciones contra las que advierten las guías de lenguaje claro en español:
|
|
360
367
|
|
|
361
|
-
* la complejidad del árbol: distancias de dependencia, profundidad, hojas y subárboles, valencia de los verbos personales, cadenas de coordinación, cláusulas
|
|
368
|
+
* la complejidad del árbol: distancias de dependencia, profundidad, hojas y subárboles, valencia de los verbos personales, cadenas de coordinación, cláusulas, subordinadas e infinitivas, los índices de L2SCA por unidades T, modificadores por sustantivo, cadenas preposicionales
|
|
369
|
+
* el orden y la semejanza: palabras antes de la raíz de la oración, sujetos y objetos antepuestos, la semejanza sintáctica de las oraciones contiguas
|
|
362
370
|
* las construcciones: la pasiva con `ser` y con `se`, las cláusulas de participio y de gerundio, las cadenas de `de`, los predicados escindidos, el `se` impersonal, las palabras de negación, la razón entre sustantivos y verbos
|
|
363
371
|
|
|
364
372
|
```python
|
|
@@ -394,10 +402,10 @@ Más en la [documentación](https://sergeyshk.github.io/esTS/es/stats/syntax_sta
|
|
|
394
402
|
|
|
395
403
|
La cohesión referencial a la manera de Coh-Metrix y de su adaptación española Coh-Metrix-Esp:
|
|
396
404
|
|
|
397
|
-
* la repetición de sustantivos, de argumentos y de palabras con contenido entre oraciones contiguas y entre todos los pares de oraciones, binaria y proporcional
|
|
405
|
+
* la repetición de sustantivos, de argumentos y de palabras con contenido entre oraciones contiguas y entre todos los pares de oraciones, binaria y proporcional, con las dos oraciones siguientes y entre párrafos (como en TAACO)
|
|
398
406
|
* la información dada: pronombres, demostrativos y palabras con contenido cuyo lema ya se había usado
|
|
399
407
|
* la cohesión temporal: la repetición del tiempo y del modo de los verbos de oraciones contiguas
|
|
400
|
-
* la densidad de
|
|
408
|
+
* la densidad de 273 marcadores del discurso españoles por clase - causales, adversativos, concesivos, temporales, aditivos, condicionales, reformulativos -, por tipo y por lugar: los que unen una oración con las anteriores o las partes de una oración
|
|
401
409
|
|
|
402
410
|
```python
|
|
403
411
|
>>> from ests import CohesionStats
|
|
@@ -537,7 +545,7 @@ Cada clase de estadísticas es también un componente de un pipeline, de modo qu
|
|
|
537
545
|
(12, ('DET', 'NOUN'), 2.0)
|
|
538
546
|
```
|
|
539
547
|
|
|
540
|
-
Las fábricas son `ests_basic`, `ests_readability`, `ests_diversity`, `ests_morph`, `ests_syntax`, `ests_cohesion`, `ests_lexical`, `ests_style`, `ests_phon` y `ests_verse`; el nombre del paso del pipeline es el nombre de la extensión. El componente `ests_blank_lines`, antes del parser, inicia una oración tras una línea en blanco, como la API de cadenas; el pipeline de `ests.utils.get_nlp` lo tiene.
|
|
548
|
+
Las fábricas son `ests_basic`, `ests_readability`, `ests_unadapted_readability`, `ests_diversity`, `ests_morph`, `ests_syntax`, `ests_cohesion`, `ests_lexical`, `ests_style`, `ests_phon` y `ests_verse`; el nombre del paso del pipeline es el nombre de la extensión. El componente `ests_blank_lines`, antes del parser, inicia una oración tras una línea en blanco, como la API de cadenas; el pipeline de `ests.utils.get_nlp` lo tiene.
|
|
541
549
|
|
|
542
550
|
Más en la [documentación](https://sergeyshk.github.io/esTS/es/components/).
|
|
543
551
|
|
|
@@ -550,12 +558,12 @@ Más en la [documentación](https://sergeyshk.github.io/esTS/es/components/).
|
|
|
550
558
|
|
|
551
559
|
Las medidas de la lingüística de corpus que comparan corpus y describen el uso de una palabra:
|
|
552
560
|
|
|
553
|
-
* palabras clave de un corpus objetivo frente a uno de referencia o frente al diccionario de frecuencias de Google Books Ngram: la razón de verosimilitud con su valor p, Log Ratio, ji cuadrado, %DIFF, BIC, ELL y la razón de momios
|
|
554
|
-
* colocaciones por logDice, MI, MI³, t-score, Dice, razón de verosimilitud, NPMI y sensibilidad mínima
|
|
561
|
+
* palabras clave de un corpus objetivo frente a uno de referencia o frente al diccionario de frecuencias de Google Books Ngram: la razón de verosimilitud con su valor p, Log Ratio, ji cuadrado, %DIFF, BIC, ELL y la razón de momios; por palabras o por n-gramas
|
|
562
|
+
* colocaciones por logDice, MI, MI³, t-score, Dice, razón de verosimilitud, NPMI y sensibilidad mínima; los colocados de una palabra a su izquierda o a su derecha
|
|
555
563
|
* la dispersión de una palabra por las partes de un texto: la DP de Gries, la DP normalizada, la D de Juilland, la D2 de Carroll, la S de Rosengren y la divergencia de Kullback-Leibler
|
|
556
564
|
* una concordancia KWIC por forma o por lema
|
|
557
|
-
* estilometría: las distancias entre textos por la Delta de Burrows y sus variantes, con la atribución de un texto a autores de referencia, los marcadores de palabras preferidas y evitadas por Zeta, el ji cuadrado de Kilgarriff, la curva de Mendenhall y el perfil de las palabras funcionales
|
|
558
|
-
* la comparación de dos corpus por
|
|
565
|
+
* estilometría: las distancias entre textos por la Delta de Burrows y sus variantes, con la atribución de un texto a autores de referencia y la Delta móvil a lo largo de un texto, los marcadores de palabras preferidas y evitadas por Zeta y sus proporciones en segmentos, el ji cuadrado de Kilgarriff, la curva de Mendenhall y el perfil de las palabras funcionales
|
|
566
|
+
* la comparación de dos corpus por 163 rasgos de un texto en ventanas del mismo tamaño: la delta de Cliff, la d de Cohen y el AUC de cada rasgo, la prueba de Mann-Whitney con la corrección de Holm y un intervalo bootstrap de la diferencia de las medianas
|
|
559
567
|
|
|
560
568
|
```python
|
|
561
569
|
>>> from ests import WordsExtractor
|
|
@@ -626,7 +634,7 @@ Más en la [documentación](https://sergeyshk.github.io/esTS/es/datasets/spanish
|
|
|
626
634
|
* [Huella literaria](https://sergeyshk.github.io/esTS/es/visualizers/fingerprinting/)
|
|
627
635
|
* [Árbol de palabras](https://sergeyshk.github.io/esTS/es/visualizers/word_tree/)
|
|
628
636
|
* [Gráficos de corpus](https://sergeyshk.github.io/esTS/es/visualizers/corpus/): dispersión léxica, un diagrama de palabras clave, una red de colocaciones
|
|
629
|
-
* [Gráficos estilométricos](https://sergeyshk.github.io/esTS/es/visualizers/stylometry/): un dendrograma, las componentes principales y el escalamiento multidimensional por la Delta, las curvas de Mendenhall
|
|
637
|
+
* [Gráficos estilométricos](https://sergeyshk.github.io/esTS/es/visualizers/stylometry/): un dendrograma, las componentes principales y el escalamiento multidimensional por la Delta, los histogramas de las distancias dentro de un autor y entre autores, la Delta móvil, los segmentos por los marcadores de Zeta, las curvas de Mendenhall
|
|
630
638
|
* [Crecimiento del vocabulario y espectro de frecuencias](https://sergeyshk.github.io/esTS/es/visualizers/vocabulary/), [longitudes de las oraciones](https://sergeyshk.github.io/esTS/es/visualizers/sentences/) con una media móvil
|
|
631
639
|
|
|
632
640
|
Los gráficos de matplotlib reciben los ejes `ax` y devuelven `Axes`; la red de colocaciones y el árbol de palabras los dibujan los ejecutables de Graphviz. La Delta coseno separa tres novelas de Galdós de tres de Unamuno:
|
|
@@ -718,9 +726,10 @@ Los informes de errores, las ideas y los pull requests son bienvenidos en las [i
|
|
|
718
726
|
* constants.py - constantes de la lengua española y de las métricas
|
|
719
727
|
* diversity_stats.py - métricas de diversidad léxica del núcleo anyTS sobre una cadena o un Doc
|
|
720
728
|
* exceptions.py - excepciones de la biblioteca
|
|
721
|
-
* extractors.py - los extractores del núcleo anyTS con los tokenizadores del español
|
|
729
|
+
* extractors.py - los extractores del núcleo anyTS con los tokenizadores del español, los párrafos de un texto
|
|
722
730
|
* morph_stats.py - estadísticas morfológicas
|
|
723
731
|
* readability_stats.py - métricas de legibilidad: las fórmulas del español sobre las del núcleo anyTS
|
|
732
|
+
* unadapted_readability_stats.py - fórmulas de legibilidad de otros idiomas
|
|
724
733
|
* style_stats.py - métricas de estilo
|
|
725
734
|
* phon_stats.py - fonoestadística
|
|
726
735
|
* syntax_stats.py - estadísticas sintácticas
|