AhmedTaha012 commited on
Commit
d4ca13d
1 Parent(s): 19299d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -19
app.py CHANGED
@@ -3,26 +3,23 @@ from transformers import pipeline
3
  sentiment_model = pipeline("text-classification", model="AhmedTaha012/managersFeedback-V1.0.7")
4
  increase_decrease_model = pipeline("text-classification", model="AhmedTaha012/nextQuarter-status-V1.1.9")
5
  ner_model = pipeline("token-classification", model="AhmedTaha012/finance-ner-v0.0.8-finetuned-ner")
6
- def main():
7
- st.title("Transcript Analysis")
8
- transcript = st.text_area("Enter the transcript:", height=200)
9
 
10
- if st.button("Analyze"):
11
- st.subheader("Sentiment Analysis")
12
- sentiment = sentiment_model(transcript)[0]['label']
13
- st.write(sentiment)
14
 
15
- st.subheader("Increase/Decrease Prediction")
16
- increase_decrease = increase_decrease_model(transcript)[0]['label']
17
- st.write(increase_decrease)
 
18
 
19
- st.subheader("NER Metrics")
20
- ner_result = ner_model(transcript)
21
- revenue = next((entity['entity'] for entity in ner_result if entity['entity'] == 'revenue'), None)
22
- if revenue:
23
- st.write(f"Revenue: {revenue}")
24
- else:
25
- st.write("Revenue not found.")
26
 
27
- if __name__ == "__main__":
28
- main()
 
 
 
 
 
 
3
  sentiment_model = pipeline("text-classification", model="AhmedTaha012/managersFeedback-V1.0.7")
4
  increase_decrease_model = pipeline("text-classification", model="AhmedTaha012/nextQuarter-status-V1.1.9")
5
  ner_model = pipeline("token-classification", model="AhmedTaha012/finance-ner-v0.0.8-finetuned-ner")
 
 
 
6
 
7
+ st.title("Transcript Analysis")
8
+ transcript = st.text_area("Enter the transcript:", height=200)
 
 
9
 
10
+ if st.button("Analyze"):
11
+ st.subheader("Sentiment Analysis")
12
+ sentiment = sentiment_model(transcript)[0]['label']
13
+ st.write(sentiment)
14
 
15
+ st.subheader("Increase/Decrease Prediction")
16
+ increase_decrease = increase_decrease_model(transcript)[0]['label']
17
+ st.write(increase_decrease)
 
 
 
 
18
 
19
+ st.subheader("NER Metrics")
20
+ ner_result = ner_model(transcript)
21
+ revenue = next((entity['entity'] for entity in ner_result if entity['entity'] == 'revenue'), None)
22
+ if revenue:
23
+ st.write(f"Revenue: {revenue}")
24
+ else:
25
+ st.write("Revenue not found.")