Update pages/3_Earnings_Semantic_Search_π_.py
Browse files
pages/3_Earnings_Semantic_Search_π_.py
CHANGED
|
@@ -14,8 +14,8 @@ def gen_annotated_text(df):
|
|
| 14 |
|
| 15 |
tag_list=[]
|
| 16 |
for row in df.itertuples():
|
| 17 |
-
label = row[
|
| 18 |
-
text = row[
|
| 19 |
if label == 'Positive':
|
| 20 |
tag_list.append((text,label,'#8fce00'))
|
| 21 |
elif label == 'Negative':
|
|
@@ -57,7 +57,6 @@ try:
|
|
| 57 |
bi_enc_dict[sbert_model_name],
|
| 58 |
emb_tokenizer,chain_type=chain_type)
|
| 59 |
|
| 60 |
-
print(result)
|
| 61 |
|
| 62 |
references = [doc.page_content for doc in result['input_documents']]
|
| 63 |
|
|
@@ -67,7 +66,7 @@ try:
|
|
| 67 |
|
| 68 |
##### Sematic Search #####
|
| 69 |
|
| 70 |
-
df = pd.DataFrame([
|
| 71 |
|
| 72 |
|
| 73 |
text_annotations = gen_annotated_text(df)[0]
|
|
|
|
| 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':
|
|
|
|
| 57 |
bi_enc_dict[sbert_model_name],
|
| 58 |
emb_tokenizer,chain_type=chain_type)
|
| 59 |
|
|
|
|
| 60 |
|
| 61 |
references = [doc.page_content for doc in result['input_documents']]
|
| 62 |
|
|
|
|
| 66 |
|
| 67 |
##### Sematic Search #####
|
| 68 |
|
| 69 |
+
df = pd.DataFrame.from_dict({'Text':[answer],'Sentiment':[sentiment_label]})
|
| 70 |
|
| 71 |
|
| 72 |
text_annotations = gen_annotated_text(df)[0]
|