In order for us to have a good understanding of the outcome of the tweet we need to see if the tweet is positive or negative. For this we will need to use some machine learning techniques.
For this task we'll need to create a new ML model which will be trained off of real tweets.
Create a python script called nlp_train.py which will read two files (positive and negative tweets) and created a trained model. This script must also write the model to disk. The name of the model will be sentimental_score_nlp.dat
Create a python script called nlp_test.py. This script will load the model created in the training and load it into memory. The script will also contain a function which is called test(str) will return the sentimental score of a given string which varies between 0.0 and 1.0.
In order for us to have a good understanding of the outcome of the tweet we need to see if the tweet is positive or negative. For this we will need to use some machine learning techniques.
For this task we'll need to create a new ML model which will be trained off of real tweets.
See this blog post: https://www.twilio.com/blog/2017/12/sentiment-analysis-scikit-learn.html
As well as this repository: https://github.com/lesley2958/natural-language-processing
Finally for saving and loading the model: https://machinelearningmastery.com/save-load-machine-learning-models-python-scikit-learn/
The task
Create a python script called
nlp_train.py
which will read two files (positive and negative tweets) and created a trained model. This script must also write the model to disk. The name of the model will besentimental_score_nlp.dat
Create a python script called
nlp_test.py
. This script will load the model created in the training and load it into memory. The script will also contain a function which is calledtest(str)
will return the sentimental score of a given string which varies between 0.0 and 1.0.