Spaces:
Build error
Build error
Commit
·
a2acdb6
1
Parent(s):
1eaadcb
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
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()
|