Python wrapper for esenin.
Project description
Esenin python
Python wrapper for json requests to esenin-server.
Installation
pip install esenin
Usage
from esenin import Client
nlp = Client(ip="127.0.0.1", port="9000")
print(nlp.get_pos("Мама мыла раму."))
id = nlp.fit_topics([["Мама", "мыла", "раму"], ["Мама", "мыла", "окно"], ["Мама", "мыла", "пол"]])
print(nlp.get_topics(id["id"], "Мама"))
Functions
.get_pos(string)
Takes arbitrary russian text and returns Part Of Speech tags.
See esenin-server for example of request and response.
.fit_topics(list of lists of string, int)
Takes list of documents, where document is a list of terms, and number of topics. Trains topic modeling algorithm with given terms and number of topics.
Returns the id of trained model, it's used in get_topics
function.
See esenin-server for example of request and response.
.get_topics(id, string)
Takes id of trained topic model and a term. Returns probabilities of a term to be in each topic.
See esenin-server for example of request and response.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
esenin-0.1.0.tar.gz
(2.0 kB
view hashes)
Built Distribution
esenin-0.1.0-py3-none-any.whl
(5.6 kB
view hashes)