Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.99 KB

nlp.md

File metadata and controls

27 lines (20 loc) · 1.99 KB

Survey Back API gives you the possibility to analyze the comments received from your users to automatically identify positive and negative sentiments. This is done thanks to pre-trained Natural Language Processing (NLP) models.

If you have set the variable USE_SENTIMENT_ANALYSIS to True in the .env file of Survey Back API, the models will be downloaded and saved locally (~2GB). Then they will be pre-loaded into memory to allow for a quicker response when they are needed. Please allow for around 2GB of additionnal RAM for the models.

When a comment is posted via the POST /comments route, the language will be automatically detected and call the relevant sentiment analysis model. The language, sentiment (POSITIVE or NEGATIVE) and the confidence score of the model are saved in the database with the comment.

If the USE_SENTIMENT_ANALYSIS is set to False, the models could not be downloaded, or the comment's language is not supported, then no sentiment analysis will be performed.

Supported language for sentiment analysis:

If you want to do further NLP using the comments from Survey Back API, we have provided a preprocess of the text which includes lowercase, removing punctuation and stopwords, tokenization and lemmatization.
This returns you a list of word tokens. It is available in the response from the GET /comments endpoint.