Installation¶
The library can be installed with pip or from the project repository with git.
Dependencies¶
python- 3.11 or neweranyts- 0.4.6 or newer within 0.4, the language-independent core ruTS is built onrumorph- 0.5 or newer within 0.5, the morphological analyzeranyseg- 0.2 or newer within 0.2, the segmenter into tokens and sentencesscipyspaCy- 3.8.15 or newernumpypandasmatplotlibgraphviz
Installing with pip¶
The release version is installed with all dependencies:
pip install ruts
Graphviz
Only the word tree and the collocation network need the Graphviz executables (brew install graphviz, apt install graphviz, conda install graphviz): the graphviz package among the dependencies is just a wrapper, and without them render() and displaying the graph in Jupyter fail with ExecutableNotFound.
import ruts loads neither spaCy nor matplotlib nor pandas: they come on first use of a Doc, components, plots and corpus functions.
spaCy model
The spaCy components, the syntactic statistics and the recommended pipeline ruts.load_pipeline() need the Russian-language model, without it loading fails with OSError: [E050]. The model is installed separately:
python -m spacy download ru_core_news_sm
The larger models ru_core_news_md and ru_core_news_lg (93 and 670 MB against 47) hardly change the ruTS statistics: on the gold Universal Dependencies annotation (Taiga and GSD) they are less than one UAS point more accurate than sm.
Datasets
The datasets are downloaded by default into the ruts_data directory next to the package (DEFAULT_DATA_DIR in ruts.constants), for an installation from a wheel into site-packages/ruts_data, where writing may be forbidden for a system Python. Your own directory is set by the data_dir argument of a dataset or by the RUTS_DATA_DIR environment variable before the package is imported:
export RUTS_DATA_DIR=~/ruts_data
Note
A guide to pip is on its website.
Installing with git¶
The latest version is installed from the project repository:
-
Clone the repository:
git clone https://github.com/SergeyShk/ruTS.git -
Change into it:
cd ruTS -
Install the library into the current environment:
pip install .For development uv is more convenient: it creates an isolated environment with all dependencies, including the development tools:
uv sync --all-groups --no-group examplesThe
examplesgroup with Jupyter is needed only for the example notebooks.
Note
A guide to git is on its website.