Skip to content

This project compares the four powerful deep learning models namely, RNN, LSTM, GRU, Bi LSTM and shows that by applying these models, how they achieves excellent result on the customer review dataset.

Notifications You must be signed in to change notification settings

roysaurabh1308/Sentiment-Analysis-using-RNN-LSTM-GRU-Bi.LSTM

Repository files navigation

Sentiment Analysis using RNN, LSTM, GRU & Bi LSTM

About

With the rapid development of the Internet, more and more users expressed their views on the Internet. Therefore, the big data of texts are generated on the Internet. Social media is generating a vast amount of sentiment rich data in the form of tweets, status updates, blog posts etc. In the era of big data and deep learning, mining the sentiment tendencies contained in massive texts on the Internet through natural language processing technology has become an important way of public opinion supervision. This analysis has a vast and great applications such as stock price prediction, election result prediction, and so on. In this paper, I have applied a simple and efficient Neural Language Model approach for text classification (Sentiment Analysis) that relies only on unsupervised word representation inputs along with word embedding technique, which has improved the model to capture syntactic and semantic word relationships. This paper shows that applying the RNN, LSTM, GRU, Bidirectional RNN models achieves excellent result on the customer review dataset.

My Models

I have applied four models for sentiment analysis and trained and tested them over the customer review dataset.

  • RNN model that employs embedding layer followed by a simple RNN layer followed by a fully connected layer with dropouts and then by an activation layer. Drive Link
  • LSTM model that employs embedding layer followed by an LSTM layer followed by a fully connected layer with dropouts and then by an activation layer. Drive Link
  • GRU model that employs embedding layer followed by a GRU layer followed by a fully connected layer with dropouts and then by an activation layer. Drive Link
  • Bidirectional RNN model that employs embedding layer followed by a bidirectional LSTM layer followed by a fully connected layer with dropouts and then by an activation layer. Drive Link

Results

  • The RNN model achieved an accuracy of 77.85% with a loss score of 0.506 on the testing data.
  • The LSTM model achieved an accuracy of 88.94% with a loss score of 0.323 on the testing data.
  • The GRU model achieved an accuracy of 84.94% with a loss score of 0.342 on the testing data.
  • The bidirectional RNN model achieved an accuracy of 90.57% with a loss score of 0.317 on the testing data.

Structure and Result

RNN Structure LSTM Structure GRU Structure
Bi LSTM Accuracy plot of RNN Accuracy plot of LSTM
Accuracy plot of GRU Accuracy plot of Bi LSTM Confusion matrix of RNN
Confusion matrix of LSTM Confusion matrix of GRU Confusion matrix of Bi LSTM

Tools Used

Future Possibilities and Extension of this project

  • Applying in real time applications like Election Result Prediction and Stock Price Estimation.
  • Fake News Prediction

Contributing

You are welcome to contribute :

  1. Fork it (https://github.com/roysaurabh1308/Sentiment-Analysis-using-RNN-LSTM-GRU-Bi.LSTM/fork)
  2. Create new branch : git checkout -b new_feature
  3. Commit your changes : git commit -am 'Added new_feature'
  4. Push to the branch : git push origin new_feature
  5. Submit a pull request !

Author

Thanks for going through this Repository! Have a nice day.
Have any querry? Feel free to contact me.

Saurabh Roy

Contact :roysaurabh1308@gmail.com

github Gmail College Mail Linkedin

License

This Project is licensed under the MIT License, see the LICENSE file for details.

About

This project compares the four powerful deep learning models namely, RNN, LSTM, GRU, Bi LSTM and shows that by applying these models, how they achieves excellent result on the customer review dataset.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published