IsaNLP - is a library with gRPC service that provides NLP for English and Russian
1.6K
IsaNLP is a Python 3 library that encompasses several open-source natural language processing tools for English and Russian and provides a framework for running them locally as a single pipeline or in a distributed environment via RPC. It also provides an easy to deploy docker container inemo/isanlp for starting various types of workers.
This service provides models and API for language detection, named entity recognition, tokenization, sentence splitting, pos-tagging, and morphology analysis. It includes NLTK, Mystem, Polyglot.
How to use:
Start docker container: docker run -ti --rm -p 3333:3333 inemo/isanlp
Install IsaNLP library. Quick tip: pip install grpcio git+https://github.com/IINemo/isanlp
Use the remote service from python code:
from isanlp import ProcessorRemote ppl = ProcessorRemote(host = 'localhost', port = 3333, pipeline_name = 'default')
text_ru = 'Мама мыла раму' annotations = ppl(text_ru) print(annotations)
The expected result is a dictionary of different types of annotations: {'lang': 'ru', 'lemma': [['мама', 'мыть', 'рама']], 'postag': [['S,жен,од=им,ед', 'V,несов,пе=прош,ед,изъяв,жен', 'S,жен,неод=вин,ед']], 'sentences': [<isanlp.annotation.Sentence at 0x7fc180c104e0>], 'text': 'Мама мыла раму', 'tokens': [<isanlp.annotation.Token at 0x7fc180c10400>, <isanlp.annotation.Token at 0x7fc180c10438>, <isanlp.annotation.Token at 0x7fc180c104a8>]}
Content type
Image
Digest
Size
739.6 MB
Last updated
over 7 years ago
docker pull inemo/isanlp