Update app.py
Browse files
app.py
CHANGED
@@ -12,22 +12,23 @@ def main():
|
|
12 |
st.set_page_config(page_title="Your Finance news", page_icon="📰")
|
13 |
st.header("Summarize Your Finance News and Analyze Sentiment")
|
14 |
text=st.text_input('Input your Finance news(Max lenth<=3000): ',max_chars=3000)
|
|
|
15 |
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
if __name__ == "__main__":
|
33 |
main()
|
|
|
12 |
st.set_page_config(page_title="Your Finance news", page_icon="📰")
|
13 |
st.header("Summarize Your Finance News and Analyze Sentiment")
|
14 |
text=st.text_input('Input your Finance news(Max lenth<=3000): ',max_chars=3000)
|
15 |
+
if isinstance(text,str):
|
16 |
|
17 |
+
st.text('Your Finance news: ')
|
18 |
+
st.write(str(text))
|
19 |
|
20 |
+
#Stage 1: Text Summarization
|
21 |
+
st.text('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 |
+
st.write(summary)
|
25 |
|
26 |
+
#Stage 2: Sentiment Analytics
|
27 |
+
st.text('Processing Sentiment Analytics...')
|
28 |
+
label = sentiment(summary)
|
29 |
+
label=label.capitalize()
|
30 |
+
st.text('The sentiment of finance news is: ')
|
31 |
+
st.write(label)
|
32 |
|
33 |
if __name__ == "__main__":
|
34 |
main()
|