0

I'm using the Flair NLP Library to get the sentiment scores of tweets . How do I handle emojis in Flair? I know that vader can handle emojis pretty well without preprocessing , but what about Flair ? What Should I add to the code to account for the meaning imposed by emojis in sentiment analysis ? Should I use the emoji library of python to demojize ? Does it work with flair ?


s = flair.data.Sentence('I am feeling great <3')
flair_sentiment.predict(s)
total_sentiment = s.labels
print(total_sentiment[0].score)

Can someone please tell me how to handle emojis in flair ?

Bharathi
  • 201
  • 1
  • 8

1 Answers1

1

VADER is a rule-based sentiment analysis which includes hardcoded rules defining how emojis influence the result of the sentiment analysis.

In contrast, flair trains a model on data to predict the sentiment of a sentence. Whether emojis and in which format (as unicode character or demojizised) are considered by the model depends on whether and how they are represented in your training data.

So you should first check whether the data used to train your sentiment models include emojis and whether they are in the same format as your input. If not, you may have to find another dataset which is closer to your input data and train a new model.

dthulke
  • 949
  • 9
  • 23