Skip to main content

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


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

Uploaded Source

Built Distribution

esenin-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file esenin-0.1.0.tar.gz.

File metadata

  • Download URL: esenin-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for esenin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f87b21ecd8816e4903c90e57e82eddebd36e4754e2bbb7735eab2612ab63a3c8
MD5 e2dff0b985dccc598b6c28889499435b
BLAKE2b-256 ca401dedd5676aecf17a0e539af65da2bbc1d15af6866f80204547d63ed84db1

See more details on using hashes here.

File details

Details for the file esenin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: esenin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for esenin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5129082a1d131327d12902521b6d6ab410018062636749ba5f13b3125cd7252e
MD5 a5251669abe2de5a57f343071df2f7a1
BLAKE2b-256 88340bdf9587b62f2ff72678d1a448b34458d28980db047eb1fe956ec74139a5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page