Giter Site home page Giter Site logo

f1uctus / ttc Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 2.97 MB

โœ ๐Ÿ—ฃ A Text-To-Conversation natural language processing toolkit [WIP].

License: GNU General Public License v3.0

Python 59.55% Nix 0.11% Jupyter Notebook 40.33%
conversation nlp nlp-apis nlp-library spacy spacy-extension spacy-nlp spacy-pipeline speaker-identification

ttc's Introduction

Text-To-Conversation toolkit (TTC)

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 (it is near 80% or worse for now);
  • 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 an example of using the library 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 Poetry.

Spawn a new virtual environment for the project:

poetry shell

Install project dependencies:

poetry install [--with dev,large_models_ru]

Contributions are very welcome!

Implementation notes

russian/*/actor_classifier.py:

ttc's People

Contributors

dependabot[bot] avatar f1uctus avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ttc's Issues

Input text must be sanitized before processing

See also: explosion/spaCy#7735

Any text to be processed by ttc should be sanitized first.
Please remove any duplicate spaces and trim any whitespace before and after the line breaks. Do not replace line breaks with spaces as the replica extraction algorithm relies on them.
Excessive whitespaces are not handled well by the underlying library, spaCy, because, for example, the dependency parsing algorithm's training dataset does not contain them. As a consequence, prediction results may lose in accuracy.

If your use case requires the text to be left as-is, you can still sanitize the input, and then map the output spans into the original text by means of accumulated indices.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.