Update pages/3_Earnings_Semantic_Search_π_.py
Browse files
pages/3_Earnings_Semantic_Search_π_.py
CHANGED
@@ -10,20 +10,20 @@ def gen_sentiment(text):
|
|
10 |
return sent_pipe(text)[0]['label']
|
11 |
|
12 |
def gen_annotated_text(df):
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
bi_enc_dict = {'mpnet-base-v2':"all-mpnet-base-v2",
|
29 |
'instructor-base': 'hkunlp/instructor-base',
|
|
|
10 |
return sent_pipe(text)[0]['label']
|
11 |
|
12 |
def gen_annotated_text(df):
|
13 |
+
'''Generate annotated text'''
|
14 |
+
|
15 |
+
tag_list=[]
|
16 |
+
for row in df.itertuples():
|
17 |
+
label = row[2]
|
18 |
+
text = row[1]
|
19 |
+
if label == 'Positive':
|
20 |
+
tag_list.append((text,label,'#8fce00'))
|
21 |
+
elif label == 'Negative':
|
22 |
+
tag_list.append((text,label,'#f44336'))
|
23 |
+
else:
|
24 |
+
tag_list.append((text,label,'#000000'))
|
25 |
+
|
26 |
+
return tag_list
|
27 |
|
28 |
bi_enc_dict = {'mpnet-base-v2':"all-mpnet-base-v2",
|
29 |
'instructor-base': 'hkunlp/instructor-base',
|