7.3.1
Sentiment analysis of text
We will use the model in『SiEBERT - English-Language Sentiment Classification』 to classify the sentiment of English sentences. I would like to classify the sentiment of each English sentence by positive and negative.
Hartmann, Jochen and Heitmann, Mark and Siebert, Christian and Schamp, Christina, “More than a feeling: Accuracy and Application of Sentiment Analysis”, International Journal of Research in Marketing(2022)
Here we use the siebert/sentiment-roberta-large-english model on huggingface, if you want to use transformers on Google Colab you need to install transformers beforehand.
| |
Analyze the sentiment of each sentence in the text #
The entire text is separated by “.” to separate each sentence.
Here, Petrobras Webcast – 3rd Quarter Results 2022 November 5, 2022 transcription data is used.
| |
Visualize the results #
Visualize the results using positive and negative labels and their scores.
| |
[score=0.9976] Hello!Hello!Hello!Hello!Hello!