This NLP library can help you with:
- Extraction of characters' replicas from literary texts;
- Identification of the actors owning these replicas.
We aim to achieve the following goals:
- Better accuracy on the actor classification task.
Replica extraction is ~99% precision/recall; actor attribution is
~70% end-to-end on held-out texts (~100% on the tuned-against set) —
see docs/eval-log.md and run
ttc evalto measure; - A larger annotated corpus (
ttc annotateopens a browser tool prefilled with pipeline predictions — see tests/russian/texts/README.md); - Support for more languages (only Russian is supported at the moment).
Install with pip is just a usual pip install . from the project dir.
As a library
You can find a library usage example in the cli.py file.
As a tool for the CLI
Test output on a text file:
ttc print-play path-to-the-text-file text-languageNotes
- Text must be encoded in UTF-8;
- Text must be sanitized (see #23);
- It is usually better to test on some middle-sized text (e.g a book chapter);
- Supported
text-languages are:- ru (russian)
Please install uv.
Spawn a new virtual environment for the project:
uv venv
source .venv/scripts/activateInstall project dependencies:
uv sync --all-groupsContributions are very welcome!
