basyx commited on
Commit
c72a61b
·
verified ·
1 Parent(s): e5ad341

Create emotion.py

Browse files
Files changed (1) hide show
  1. utils/emotion.py +14 -0
utils/emotion.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def emotion_score(words):
2
+
3
+ strong_words = [
4
+ "amazing", "crazy", "insane", "love", "hate",
5
+ "never", "always", "big", "huge", "shocking"
6
+ ]
7
+
8
+ score = 0
9
+
10
+ for w in words:
11
+ if w["text"].lower() in strong_words:
12
+ score += 2
13
+
14
+ return min(score, 100)