Created
January 1, 2019 19:27
-
-
Save bluedistro/9a4d7e6cac6814a2ed169447c6f78f58 to your computer and use it in GitHub Desktop.
Scale polarity
This file contains 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
def review_rating(score, decoded_review): | |
if float(score) >= 0.9: | |
print('Review: {}\nSentiment: Strongly Positive\nScore: {}'.format(decoded_review, score)) | |
elif float(score) >= 0.7 and float(score) < 0.9: | |
print('Review: {}\nSentiment: Positive\nScore: {}'.format(decoded_review, score)) | |
elif float(score) >= 0.5 and float(score) < 0.7: | |
print('Review: {}\nSentiment: Okay\nScore: {}'.format(decoded_review, score)) | |
else: | |
print('Review: {}\nSentiment: Negative\nScore: {}'.format(decoded_review, score)) | |
print('\n\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment