Created
February 13, 2019 01:56
-
-
Save AnasAlmasri/b3ec0af330408098be47ff950e889528 to your computer and use it in GitHub Desktop.
running the model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NBResultLabels = [NBayesClassifier.classify(extract_features(tweet[0])) for tweet in preprocessedTestDataSet] | |
| # get the majority vote | |
| if NBResultLabels.count('positive') > NBResultLabels.count('negative'): | |
| print("Overall Positive Sentiment") | |
| print("Positive Sentiment Percentage = " + str(100*NBResultLabels.count('positive')/len(NBResultLabels)) + "%") | |
| else: | |
| print("Overall Negative Sentiment") | |
| print("Negative Sentiment Percentage = " + str(100*NBResultLabels.count('negative')/len(NBResultLabels)) + "%") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment