-
-
Save amankharwal/2f4508e0907d46cd75efa2fc32e4593f to your computer and use it in GitHub Desktop.
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
emoji_dict = {"joy":"😂", "fear":"😱", "anger":"😠", "sadness":"😢", "disgust":"😒", "shame":"😳", "guilt":"😳"} | |
t1 = "This looks so impressive" | |
t2 = "I have a fear of dogs" | |
t3 = "My dog died yesterday" | |
t4 = "I don't love you anymore..!" | |
texts = [t1, t2, t3, t4] | |
for text in texts: | |
features = create_feature(text, nrange=(1, 4)) | |
features = vectorizer.transform(features) | |
prediction = clf.predict(features)[0] | |
print( text,emoji_dict[prediction]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment