Skip to content

A Deep Learning Recurrent Neural Network by PyTorch to identify the different emotions in the text, feedback & paragraph by training the model to predict accurately, the emotions of anger, fear, joy, surprise & sadness

Notifications You must be signed in to change notification settings

DarinJoshua-dev/Deep-Learning-Text-Emotion-Analyzer

Repository files navigation

Deep-Learning-Text-Emotion-Analyzer

Created this Deep Learning (DL) RNN model - Deep Learning Text Emotion Analyzer project as an outcome of the TCS iON Internship for Artificial Intelligence.

#Project Synopsis:

  • Implementation of the Deep Learning Recurrent Neural Network Algorithm by PyTorch to identify the different emotions in the text, feedback and paragraph by training the model to predict accurately, the emotions of anger, fear, joy, surprise and sadness using a pickled Emotion-Text Dataset by the Analysis & RNN model Algorithm implemented by PyTorch to evaluate above 91% accuracy in test.

  • The RNN Model is Capable of solving many real-world problems, especially has proved efficient in Text Emotion Detection and Analysis by accurate test results and Strong Neural Network Framework of PyTorch. (Using TensorFlow Framework, CNN Model was also tested and proved good results)

#Solution Approach:

➔ Learnt so much from practical and learning from various forums, web and TCS iON discussion panel. Also took the time seriously in venturing multiple resources also the ones listed in self-learning by TCS iON to gain knowledge and hands-on practice for the implementation of projects.

➔ Started with Artificial Intelligence and Machine Learning and went along refreshing the Python. Basics of ML/DL Models with MNIST and IMDB models and all commands.

➔ Researched the Best ML/DL Models and Frameworks. Studied the different packages ranging from pandas, numpy, scikit, scipy, pickle, matplotlib, regex to nltk, etc.

➔ Did a lot of self-learning making myself capable of determining errors, use cases, problems, solution and data processing efficiently. Went through a lot of Documentation and Online Tutorials.

➔ Made myself equipped in solving real-world problems by solving and making aware of different outcomes. Also submitted the Daily Reports regularly and completed both the pre-test and project test on the allotted days.

➔ Explored multiple frameworks ranging from Keras, Chainer, mxnet, TensorFlow and PyTorch. Implemented multiple models using the TensorFlow, Keras and PyTorch frameworks by CNN, RNN and LSTM Models. Used multiple web resources in determining and using the best model and its implementation.

#Assumptions:

● Does the selected model satisfy the required description of determining the emotions of the text?

● Does the model process the data and refine the clean text data to assume the different modes like sarcastic, short forms, etc.

● The model performs the training the training accurately and test result is positive

#Algorithms:

Recurrent Neural Network Model by using PyTorch executed on Google Colab (Emotion Dataset).

  1. Eager execution
  2. Basic math with tensors
  3. Transforming tensors
  4. Preprocessing data
  5. Tokenization and Sampling
  6. Constructing Vocabulary and Index-Word Mapping
  7. Converting data into tensors
  8. Padding data
  9. Binarization
  10. Split data
  11. Data Loader
  12. Pretesting Model
  13. Testing models with eager execution
  14. Training
  15. Evaluation on Testing Dataset
  16. Confusion matrix

#Outcome:

➔ Explored multiple frameworks ranging from Keras, Chainer, mxnet, TensorFlow and PyTorch. Implemented multiple models using the TensorFlow, Keras and PyTorch frameworks by CNN, RNN and LSTM Models. Used multiple web resources in determining and using the best model and its implementation.

➔ Tested and evaluated the model for prediction and analysis using three different models and chose the best model which was found to be PyTorch which implemented the RNN and Eager Execution perfectly.

➔ Used Three Different Datasets Emotion_Text, Emotions_Set and Emotions_Standard. Found that Emotion_Text Executed with high accuracy of over 91% with RNN Model by PyTorch.

Exceptions considered:

● The Model can be made to perform more accurately by training the model and refining the code for better test and better dataset.

● The model neglected the nltk, TensorFlow, Keras, etc which could be used to develop models of CNN, Navies Bayes, Classification, etc which could perform. Enhancement Scope:

● The CNN, Bi-LSTM and LSTM models can also be applied and further improvements can be done to increase the perfomance of the DL model.

● The size of hidden layer and math can be altered. Also different changes to the neurons of the RNN to further optimize the model and training to get better prediction.

● Further optimization of applying detailed layers to neural networks in an innovative way can be considered. Other packages can also be used for enhancing the project.

#Final Words:

Gained lot of experience and Industrial exposure in the field of Artificial Intelligence after completion of the project and successfully defining a valid and performing DL Algorithm Model Output. It has boosted confidence, standard of learning and adapting of different ML/DL Models and exploring them. The future of technology is fascinating to learn and execute as the same way.

About

A Deep Learning Recurrent Neural Network by PyTorch to identify the different emotions in the text, feedback & paragraph by training the model to predict accurately, the emotions of anger, fear, joy, surprise & sadness

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published