AhmedTaha012 commited on
Commit
d91e017
1 Parent(s): 3cfce0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
- from transformers import AutoTokenizer,AutoModelForTokenClassification
4
  import math
5
  import nltk
6
  import torch
@@ -18,10 +18,10 @@ sentiment_model = pipeline("text-classification", model="AhmedTaha012/managersFe
18
  increase_decrease_model = pipeline("text-classification", model="AhmedTaha012/nextQuarter-status-V1.1.9")
19
  tokenizerTopic = AutoTokenizer.from_pretrained("nickmuchi/finbert-tone-finetuned-finance-topic-classification",use_fast=True)
20
  modelTopic = AutoModelForSequenceClassification.from_pretrained("nickmuchi/finbert-tone-finetuned-finance-topic-classification")
21
- torch.compile(modelTopic)
22
  tokenizer = AutoTokenizer.from_pretrained("AhmedTaha012/finance-ner-v0.0.9-finetuned-ner")
23
  model = AutoModelForTokenClassification.from_pretrained("AhmedTaha012/finance-ner-v0.0.9-finetuned-ner")
24
- torch.compile(model)
25
  # torch.compile(model)
26
  nlpPipe = pipeline("ner", model=model, tokenizer=tokenizer, grouped_entities=True)
27
  def getSpeakers(data):
@@ -243,7 +243,8 @@ if st.button("Analyze"):
243
  sentiment_color = "green" if sentiment == "postive" else "red"
244
  st.markdown(f'<span style="color:{sentiment_color}">{sentiment}</span>', unsafe_allow_html=True)
245
  st.subheader("Next Quarter Perdiction", divider='rainbow')
246
- increase_decrease = [increase_decrease_model(x)[0]['label'] for x in chunks]
 
247
  increase_decrease=max(increase_decrease,key=increase_decrease.count)
248
  increase_decrease_color = "green" if increase_decrease == "Increase" else "red"
249
  st.markdown(f'<span style="color:{increase_decrease_color}">{increase_decrease}</span>', unsafe_allow_html=True)
 
1
  import streamlit as st
2
  from transformers import pipeline
3
+ from transformers import AutoTokenizer,AutoModelForTokenClassification,AutoModelForSequenceClassification
4
  import math
5
  import nltk
6
  import torch
 
18
  increase_decrease_model = pipeline("text-classification", model="AhmedTaha012/nextQuarter-status-V1.1.9")
19
  tokenizerTopic = AutoTokenizer.from_pretrained("nickmuchi/finbert-tone-finetuned-finance-topic-classification",use_fast=True)
20
  modelTopic = AutoModelForSequenceClassification.from_pretrained("nickmuchi/finbert-tone-finetuned-finance-topic-classification")
21
+ # torch.compile(modelTopic)
22
  tokenizer = AutoTokenizer.from_pretrained("AhmedTaha012/finance-ner-v0.0.9-finetuned-ner")
23
  model = AutoModelForTokenClassification.from_pretrained("AhmedTaha012/finance-ner-v0.0.9-finetuned-ner")
24
+ # torch.compile(model)
25
  # torch.compile(model)
26
  nlpPipe = pipeline("ner", model=model, tokenizer=tokenizer, grouped_entities=True)
27
  def getSpeakers(data):
 
243
  sentiment_color = "green" if sentiment == "postive" else "red"
244
  st.markdown(f'<span style="color:{sentiment_color}">{sentiment}</span>', unsafe_allow_html=True)
245
  st.subheader("Next Quarter Perdiction", divider='rainbow')
246
+ # increase_decrease = [increase_decrease_model(x)[0]['label'] for x in chunks]
247
+
248
  increase_decrease=max(increase_decrease,key=increase_decrease.count)
249
  increase_decrease_color = "green" if increase_decrease == "Increase" else "red"
250
  st.markdown(f'<span style="color:{increase_decrease_color}">{increase_decrease}</span>', unsafe_allow_html=True)