File size: 1,147 Bytes
a2acdb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import streamlit as st
from transformers import pipeline
sentiment_model = pipeline("text-classification", model="AhmedTaha012/managersFeedback-V1.0.7")
increase_decrease_model = pipeline("text-classification", model="AhmedTaha012/nextQuarter-status-V1.1.9")
ner_model = pipeline("token-classification", model="AhmedTaha012/finance-ner-v0.0.8-finetuned-ner")
def main():
    st.title("Transcript Analysis")
    transcript = st.text_area("Enter the transcript:", height=200)

    if st.button("Analyze"):
        st.subheader("Sentiment Analysis")
        sentiment = sentiment_model(transcript)[0]['label']
        st.write(sentiment)

        st.subheader("Increase/Decrease Prediction")
        increase_decrease = increase_decrease_model(transcript)[0]['label']
        st.write(increase_decrease)

        st.subheader("NER Metrics")
        ner_result = ner_model(transcript)
        revenue = next((entity['entity'] for entity in ner_result if entity['entity'] == 'revenue'), None)
        if revenue:
            st.write(f"Revenue: {revenue}")
        else:
            st.write("Revenue not found.")

if __name__ == "__main__":
    main()