ICP_Deep Learning 5 - PallaviArikatla/Python GitHub Wiki
INTRODUCTION: Sentiment Analysis on the Twitter data.
IMPLEMENTATION:
Actual loss and accuracy before adding layers.
Question 1: Save the model and use the saved model to predict on new text data (ex, “A lot of good things are happening. We are respected again throughout the world, and that's a great thing.@realDonaldTrump”).
- Import all the necessary libraries.
- Read only the necessary columns in the dataset.
- Convert the text data.
- By using tokenizers, perform fit to text and then text to sequence methods.
- Add the embedded layer.
- Convert the data to numerical form and then calculate loss and accuracy.
Question 2: Apply GridSearchCV on the Sentiment dataset.
- Repeat the above procedure and use grid search CV to find out the best hyper parameters to train the model.
- Find the accuracy.
Question 3: Apply the code on spam data set.
- Perform same operations as in question 1.
- Use spam dataset.
- Initialize and compile the model.
- Calculate loss and accuracy.
output:
Bonus Question: Visualize Loss and Accuracy.
- Fit the model.
- Plot loss and accuracy.
output: