Skip to content

F1uctus/ttc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

945 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-To-Conversation toolkit (TTC)

Coverage

This NLP library can help you with:

  • Extraction of characters' replicas from literary texts;
  • Identification of the actors owning these replicas.

Demo (CLI)

Progress

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 eval to measure;
  • A larger annotated corpus (ttc annotate opens a browser tool prefilled with pipeline predictions — see tests/russian/texts/README.md);
  • Support for more languages (only Russian is supported at the moment).

Installation

Install with pip is just a usual pip install . from the project dir.

Usage

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-language

Notes

  • 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)

Development

Please install uv.

Spawn a new virtual environment for the project:

uv venv
source .venv/scripts/activate

Install project dependencies:

uv sync --all-groups

Contributions are very welcome!

Implementation notes

russian/*/actor_classifier.py:

Coverage Map

About

✍ 🗣 Text-To-Conversation: extracting dialogue and attributing speakers in fiction books (spaCy).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors