Sentiment analysis
Get sentiment for each value in a column of the dataframe

Get

This will return the dataframe with a column with values Positive, Negative or Neutral and the score depending on the sentiment of the corresponding column value.
Exemple of data in dataset:
Dialogue
Sentiment
Score
The lunch was delicious
Positive
0.5719
I had a bad day
Negative
-0.5423
1
naas_drivers.sentiment.get(
2
dataset=dataset,
3
column_name="Dialogue",
4
details= False
5
)
Copied!

Categorize

Define if sentiment is positif, neutral or negatif
1
sentiment = 0.03
2
result = naas_drivers.sentiment.categorize(sentiment)
3
# result = 'neutral'
Copied!
Copy link
Edit on GitHub