The idea of this project is to build a sentiment analysis model that detects the emotions that underlie a tweet. It makes associations between words and emotions and the aim is to classify the tweets into sentiments like anger, happiness, sadness, enthusiasm etc. rather than the usual sentiment classification that only involves truly contrasting sentiments of Positive and Negative.
How does it work?
- Long Short-Term Memory networks — usually just called “LSTMs” — are a special kind of RNN, capable of learning long-term dependencies. The reason that this model was chosen is that a basic RNN can learn dependencies however, it can only learn about recent information. But LSTM can help solve this problem as it can understand context along with recent dependency. Hence, LSTM are a special kind of RNN where understanding context can help to be useful, and context is the basic key between differentiating the sentiment labels separately.
- After pre-processing the data, the contents of the tweets are tokenized and pushed into a Sequential LSTM model with 4 layers. The model is trained for 15 epochs with 64 as the batch size. “categorical_crossentropy” is used as the Loss function and the “adam” optimizer is used. The model is fit with contents of the tweets as X and it’s respective sentiment as y in the form of vectors.
- Requires large amount of training data.
- The model performance entirely depends on the scale of the training dataset.
Write a Review
Leave a reply Cancel reply