Skip to content


Repository files navigation


Lettria edits a NLP toolkit dedicated to the understanding of french.

This is our official SDK for Python, designed to make the usage of our API straightforward, quick and efficient.

Learn more about our API and its format with our tutorials, documentation and demo.



Name Description
Tokenization Segmenting text into sentences and sentences into words, punctuations marks etc.
Subsentence detection Segmenting sentences into 'subsentences' for a finer analysis.
Part-of-speech (POS) Tagging Finding the word type of each token like noun, adjective or verb.
Dependency Parsing Finding the relations between individual tokens by assigning them dependency labels, like subject, determinant or object.
Lemmatization Finds for each token its 'base' form, for example the lemma of "est” is “être”, and the lemma of "oiseaux” is "oiseau”.
Named Entity Recognition (NER) Detection of numerous "entities" such as locations, persons, quantities or dates.
Natural Language Understanding (NLU) Interpreting the meaning of each token by identifying its meaning category and lexicon.
Coreference Identifying coreference links between different tokens.
Sentiment Analysis Analysing sentimental value of input text (positive, negative or neutral), by sentence or subsentence.
Emotion Analysis Analysing emotional value of input text (positive, negative or neutral), by sentence or subsentence.
Sentence Type classification Detecting the type of the sentence (question, assertion, command, exclamation).
Language detection Detecting the language of the sentence.


pip (recommended)

Install from PyPi using pip, a package manager for Python.

pip install lettria

If you dont' have pip, you can install it by running this from the command line:

$ curl | python

source code

You can download the source code and then run:

python install

Getting your API key

In order to start making requests you need an API key. You can start right now by creating a free key.


NLP class

As a quick introduction we are going to perform a request on two documents and request relevant information from the results. A 'document' is any bit of information that you wish to analyse individually, for example a review in a dataset of online reviews.

import lettria

api_key = ' YOU API KEY'
nlp = lettria.NLP(api_key)

documents = [
	['first document, my first sentence. my second sentence'],
	['second document, my first sentence, my second sentence']

#Performs requests to Lettria's API
for doc in documents:

#Saving results for further usage.

#Print list of lemma for all the data requested

#Print list of token per document
for document in nlp:

#Print POS tags, dependency tags by accessing sentences directly.
for sentence in nlp.sentences:
	print(sentence.pos, sentence.dep)


Our documentation is available online on our website or locally. You can also find tutorials that will introduce you to our API and SDK and guide you to perform specific usecases.


No description, website, or topics provided.







No releases published


No packages published