AhmedTaha012 commited on
Commit
e3f78a5
1 Parent(s): 2d6f95f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -8,10 +8,10 @@ from nltk.corpus import stopwords
8
  import spacy
9
  from spacy import displacy
10
  from word2number import w2n
11
- import en_core_web_md
12
  nltk.download('punkt')
13
  nltk.download('stopwords')
14
- nlp = en_core_web_md.load()
15
  sentiment_model = pipeline("text-classification", model="AhmedTaha012/managersFeedback-V1.0.7")
16
  increase_decrease_model = pipeline("text-classification", model="AhmedTaha012/nextQuarter-status-V1.1.9")
17
  tokenizer = AutoTokenizer.from_pretrained("AhmedTaha012/finance-ner-v0.0.9-finetuned-ner")
@@ -233,20 +233,20 @@ if st.button("Analyze"):
233
  st.text_input(f'Profit:{idx+1}', profits[idx])
234
  for idx in range(len(expences)):
235
  st.text_input(f'Expences:{idx+1}', expences[idx])
236
- st.subheader("Parts from transcript that contais financial metrics", divider='rainbow')
237
- for idx in savedchunks:
238
- doc = nlp(chunks[idx])
239
- entity_list=nlpPipe(chunks[idx])
240
- entities = []
241
- for entity in entity_list:
242
- span = doc.char_span(entity['start'], entity['end'], label=entity['entity_group'])
243
- entities.append(span)
244
- try:
245
- doc.ents = entities
246
- ent_html = displacy.render(doc, style="ent", jupyter=False)
247
- st.markdown(ent_html, unsafe_allow_html=True)
248
- except:
249
- pass
250
  st.subheader("Investment Recommendation", divider='rainbow')
251
  profitAmount=sum([convert_amount_to_number(x) for x in profits])
252
  expencesAmount=sum([convert_amount_to_number(x) for x in expences])
 
8
  import spacy
9
  from spacy import displacy
10
  from word2number import w2n
11
+
12
  nltk.download('punkt')
13
  nltk.download('stopwords')
14
+
15
  sentiment_model = pipeline("text-classification", model="AhmedTaha012/managersFeedback-V1.0.7")
16
  increase_decrease_model = pipeline("text-classification", model="AhmedTaha012/nextQuarter-status-V1.1.9")
17
  tokenizer = AutoTokenizer.from_pretrained("AhmedTaha012/finance-ner-v0.0.9-finetuned-ner")
 
233
  st.text_input(f'Profit:{idx+1}', profits[idx])
234
  for idx in range(len(expences)):
235
  st.text_input(f'Expences:{idx+1}', expences[idx])
236
+ # st.subheader("Parts from transcript that contais financial metrics", divider='rainbow')
237
+ # for idx in savedchunks:
238
+ # doc = nlp(chunks[idx])
239
+ # entity_list=nlpPipe(chunks[idx])
240
+ # entities = []
241
+ # for entity in entity_list:
242
+ # span = doc.char_span(entity['start'], entity['end'], label=entity['entity_group'])
243
+ # entities.append(span)
244
+ # try:
245
+ # doc.ents = entities
246
+ # ent_html = displacy.render(doc, style="ent", jupyter=False)
247
+ # st.markdown(ent_html, unsafe_allow_html=True)
248
+ # except:
249
+ # pass
250
  st.subheader("Investment Recommendation", divider='rainbow')
251
  profitAmount=sum([convert_amount_to_number(x) for x in profits])
252
  expencesAmount=sum([convert_amount_to_number(x) for x in expences])