Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sentiment analysis of non-English texts

I want to analyze sentiment of texts that are written in German. I found a lot of tutorials on how to do this with English, but I found none on how to apply it to different languages.

I have an idea to use the TextBlob Python library to first translate the sentences into English and then to do sentiment analysis, but I am not sure whether or not it is the best way to solve this task.

Or are there any other possible ways to solve this task?

like image 367
warmspringwinds Avatar asked Mar 20 '15 15:03

warmspringwinds


2 Answers

Now there is a pre-trained sentiment classifier for German text. Hugging Face has released two open-source APIs as follows.

  1. oliverguhr/german-sentiment-bert
  2. bert-base-german-cased-sentiment-Germeval17
like image 89
Neelisha SAXENA Avatar answered Sep 18 '22 12:09

Neelisha SAXENA


As Andy has pointed about above, the best approach would be to train your own classifier. Another, more quick and dirty approach would be to use a German sentiment lexicon such as the SentiWS, and compute the polarity of a sentence simply on the basis of the polarity values of its individual words (for example by summing them). This method isn't foolproof (it doesn't take negation into account, for example), but it would give reasonable results relatively quickly.

like image 41
yvespeirsman Avatar answered Sep 22 '22 12:09

yvespeirsman