nickmuchi commited on
Commit
09c79f1
β€’
1 Parent(s): c57a7fa

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[3]
18
- text = row[2]
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([(num,res,lab) for num, res, lab in zip(range(1),answer,sentiment_label)],columns=['Index','Text','Sentiment'])
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]