WillWEI0103 commited on
Commit
27f8302
·
verified ·
1 Parent(s): 29a4943

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -36
app.py DELETED
@@ -1,36 +0,0 @@
1
- import streamlit as st
2
- from transformers import pipeline
3
- import time
4
-
5
- def sentiment(summary):
6
- pipe = pipeline("text-classification", model="WillWEI0103/CustomModel_finance_sentiment_analytics")
7
- label = pipe(summary)[0]['label']
8
- return label
9
-
10
-
11
- def main():
12
- dicts={"bullish":'Positive📈',"bearish":'Negative📉','neutral':"Neutral😐"}
13
- st.header("Summarize Your Finance News and Analyze Sentiment📰")
14
- text=st.text_input('Input your Finance news(Max lenth<=3000): ',None,max_chars=3000)
15
- if text is not None:
16
-
17
- st.text_area('Your Finance News: ',text,height=100)
18
-
19
- #Stage 1: Text Summarization
20
- #st.text('Processing Finance News Summarization...')
21
- with st.status("Processing Finance News Summarization..."):
22
- text_summarize=pipeline("summarization", model="nickmuchi/fb-bart-large-finetuned-trade-the-event-finance-summarizer")
23
- summary=text_summarize(text)[0]['summary_text']
24
- status.update(label="Summarization Completed", state="complete", expanded=False)
25
- st.text_area('Your Finance News Summary',summary,height=30)
26
-
27
- #Stage 2: Sentiment Analytics
28
- with st.status("Processing Sentiment Analytics.."):
29
- #st.text('Processing Sentiment Analytics...')
30
- label = sentiment(summary)
31
- label=dicts[label]
32
- status.update(label="Sentiment Analytics Completed", state="complete", expanded=False)
33
- st.text_area('The sentiment of finance news is: ',label)
34
-
35
- if __name__ == "__main__":
36
- main()