Examples¶
Jupyter notebooks in the examples/ directory of the repository. Each opens in Google Colab with a button and installs the library and the spaCy model itself; the outputs of all cells are stored in the files, so the notebooks can be read without running.
Text walkthrough¶
01_text_walkthrough.ipynb - Chekhov's short story "The Death of a Government Clerk" through every tool of the library in turn: sentence and word extraction, basic statistics, readability with coefficient presets, lexical diversity and windowed computation, morphology, SEO style metrics on fiction and on officialese, phonostatistics, syntax and cohesion from the spaCy parse, lexical sophistication by the frequency dictionary, highlighting, Zipf's law and the sentence length curve. At the end all statistics are attached as spaCy components, and a single nlp.pipe pass over the TextsByGrade dataset yields a table of statistics by text grade. The notebook is in Russian.
Text complexity by school grade¶
02_text_complexity_by_grade.ipynb - the 68 TextsByGrade texts labelled with grades 1 to 17 as a single complexity axis onto which every group of statistics is laid in turn: Spearman correlation of the eleven readability formulas with the label and their error in grades, three coefficient presets, lexical diversity (unrelated to grade) versus lexical sophistication by the frequency dictionary, syntax and morphology (nominal load, tree depth, passive, share of verbs), cohesion, distributions by school stage and a check on the independent first-grade reader SovChLit. The notebook is in Russian.
Pairwise comparison of prose writers¶
03_prose_authors.ipynb - ten prose writers of RussianLiterature, 200 windows of 1000 words each, 130 text_features and Cliff's delta for 45 pairs: the three strongest features of every pair, a detailed look at Tolstoy and Dostoevsky (compare_features, feature distributions, keywords - speech against narration), the number of large-effect features as a distance (from 6 for Gogol-Turgenev to 67 for Herzen-Dostoevsky), edition features (quotes, the letter ё) that must be excluded, universal discriminators (semicolons, ellipses, word length, windowed diversity measures), dendrogram and multidimensional scaling by features and by Burrows's delta with a Mantel test, authorship attribution of 1000-word windows with held-out works (delta variants, number of frequent words, word forms against character trigrams, text features as a classifier, confusion matrix, Zeta markers). The notebook is in Russian.
Stalin's language over half a century¶
04_stalin_corpus.ipynb - corpus measures as tools of diachrony on StalinWorks (1243 texts from 1901 to 1952, four periods): keywords against the frequency dictionary and lemmatization artefacts when comparing with an external dictionary, keywords of the periods and keyness_plot of the two extreme periods, collocates of the words «враг» (enemy) and «партия» (party) by period via collocations with node, dispersion of words over the volumes and dispersion_plot as a timeline, the kwic concordance by lemma, Zipf's law and windowed MTLD for every period. The notebook is in Russian.
Verse and sound¶
05_poetry.ipynb - verse statistics and phonostatistics on PoetryCorpus (16,694 poems, 18th-20th centuries): the Onegin stanza through VerseStats (stresses, cC patterns, ABABCCDDEFFEGG, line endings, stress profile), meters by era and the number of feet in iambs (the alexandrine of the 18th century, the peak of iamb under Pushkin, ternary meters from the 1840s, dolniks and accentual verse of the 20th century as meter None), the stress profile of the iambic tetrameter of Lomonosov, Pushkin and Blok against Taranovsky's manual counts, meters by author, quatrain rhyme schemes and line endings by era, blank and free verse, stressed vowels and textbook sound painting, alliteration indices and "hardness" by author, alliteration highlighting, a check of stresses and rhymes on the RIFMA dataset. The notebook is in Russian.
Running locally¶
uv sync --group examples
uv run jupyter lab examples/
make notebooks executes all notebooks, writes the outputs into the files and strips the execution metadata; the examples.yml workflow runs the notebooks on a schedule and on demand.