In this age of data and AI, sentiment analysis has become a valuable tool, enabling businesses to decode customer feedback, detect brand sentiment, and guide their strategies. In this post, let’s explore the broader topic that sentiment analysis falls into: emotion detection.
Emotion detection aims to identify the specific emotions expressed in a piece of text, such as happiness, sadness, anger, surprise, among others.
There are two primary techniques used for emotion detection: rule-based approaches and machine learning approaches. For a short explanation of these types of models, please have a watch at this video tutorial:
In rule-based approaches, a piece of text is analyzed and its emotional tone is determined based on the words it contains, according to a predefined list of lexicon of words that are associated with different emotions.
Machine learning approaches involve training a model to learn from past examples. Relevant models include the natural language toolkit, and neural network models such as convolutional neural networks, recurrent neural networks, and transformer-based models like BERT and GPT-3.
Below is a simple sentiment analysis example:
This code returns a polarity and subjectivity score. The polarity score ranges from -1 (negative sentiment) to 1 (positive sentiment), and the subjectivity score ranges from 0 (objective) to 1 (subjective).
Based upon this basic model, we could build more complex deep learning models to detect more precise emotions.
Looking forward into the near future, as other technologies such as voice recognition and facial recognition become more mature, emotion detection models are set to become ever more integrated to bring more value to various professional and civil use.
AIQ by Nick Polson and James Scott
At its tech conference in 2017, Google boldly announced that machines had now reached parity with humans at speech recognition, with a per-word dictation error rate of 4.9% - drastically better than the 20-30% error rates common as recently as 2013. This quantum leap in linguistic performance is a huge reason why machines now seem so smart. One might argue, in fact, that human-level speech recognition is the last decade’s single most important breakthrough in AI.
CodeChat
CodeChat will continue this month and to be held on July 28 at 5pm EST. The topic is going to be on natural language processing and their uses, joiners’ perspectives, as well as any questions you may have related to coding. You may sign up here for a meeting reminder or the meeting link is here if you would like to join directly.
Feedback
The Substackers’ message board is a place where you can share your coding journey with me, so that we can exchange ideas and become better together.
Please open the message board and share with me your thoughts!