Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
|
5 |
def sentiment(summary):
|
6 |
pipe = pipeline("text-classification", model="WillWEI0103/CustomModel_finance_sentiment_analytics")
|
@@ -18,9 +22,7 @@ def main():
|
|
18 |
st.write(str(text))
|
19 |
|
20 |
#Stage 1: Text Summarization
|
21 |
-
|
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
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
+
def text_summarize(text):
|
4 |
+
st.text('Processing Finance News Summarization...')
|
5 |
+
pipe=pipeline("summarization", model="nickmuchi/fb-bart-large-finetuned-trade-the-event-finance-summarizer")
|
6 |
+
summary = text_summarize(text)[0]['summary_text']
|
7 |
+
return summary
|
8 |
|
9 |
def sentiment(summary):
|
10 |
pipe = pipeline("text-classification", model="WillWEI0103/CustomModel_finance_sentiment_analytics")
|
|
|
22 |
st.write(str(text))
|
23 |
|
24 |
#Stage 1: Text Summarization
|
25 |
+
summary=text_summarize(text)
|
|
|
|
|
26 |
st.write(summary)
|
27 |
|
28 |
#Stage 2: Sentiment Analytics
|