Creating a LSTM neural network for predicting the sentiment of the review using a data set of 5000 positive and 5000 negative reviews.
Long Short-Term Memory networks — usually just called “LSTMs” — are a special kind of RNN, capable of learning long-term dependencies. LSTMs don’t have a fundamentally different architecture from RNNs, but they incorporate additional components.
The key to LSTMs is the cell state C(t), the horizontal line running through the top of the diagram. A cell state is an additional way to store memory, besides just only using the hidden state h(t). However, C(t) makes it possible that LSTMs can work with much longer sequences in opposite to vanilla RNNs.
SVM is a supervised(feed-me) machine learning algorithm that can be used for both classification or regression challenges. Classification is predicting a label/group and Regression is predicting a continuous value. SVM performs classification by finding the hyper-plane that differentiate the classes we plotted in n-dimensional space.
The given model contains two text files, containing positive and negative reviews seperately, I would like to thank Artem Opperman for providing me the data set.
Accuracy in predicting the positive review and negative reviews
LSTM | Accuracy |
---|---|
Positive | 66.71 |
Negative | 77.92 |
SVM | Accuracy |
---|---|
Positive | 75.71 |
Negative | 74.92 |
- https://towardsdatascience.com/sentiment-analysis-with-deep-learning-62d4d0166ef6
- https://www.kaggle.com/ngyptr/lstm-sentiment-analysis-keras/notebook