Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,11 +9,10 @@ analysis = pipeline("text-classification", model='ZephyruSalsify/FinNews_Sentime
|
|
| 9 |
classification = pipeline("text-classification", model="nickmuchi/finbert-tone-finetuned-finance-topic-classification", token=access+token)
|
| 10 |
|
| 11 |
st.set_page_config(page_title="Financial News Analysis", page_icon="♕")
|
| 12 |
-
st.header("Make Analysis for Financial News")
|
| 13 |
|
| 14 |
# Streamlit application layout
|
| 15 |
st.title("Financial News Analysis")
|
| 16 |
-
st.write("
|
| 17 |
st.image("./Fin.jpg", use_column_width = True)
|
| 18 |
|
| 19 |
# Text input for user to enter the text
|
|
@@ -30,19 +29,19 @@ if st.button("Analyze"):
|
|
| 30 |
max_score_1 = float('-inf')
|
| 31 |
max_label_1 = ''
|
| 32 |
|
| 33 |
-
for
|
| 34 |
-
if
|
| 35 |
-
max_score_1 =
|
| 36 |
-
max_label_1 =
|
| 37 |
|
| 38 |
# Display the classification result
|
| 39 |
max_score_2 = float('-inf')
|
| 40 |
max_label_2 = ''
|
| 41 |
|
| 42 |
-
for
|
| 43 |
-
if
|
| 44 |
-
max_score_2 =
|
| 45 |
-
max_label_2 =
|
| 46 |
|
| 47 |
st.write("Financial Text:", text)
|
| 48 |
st.write("Trend:", max_label_1)
|
|
|
|
| 9 |
classification = pipeline("text-classification", model="nickmuchi/finbert-tone-finetuned-finance-topic-classification", token=access+token)
|
| 10 |
|
| 11 |
st.set_page_config(page_title="Financial News Analysis", page_icon="♕")
|
|
|
|
| 12 |
|
| 13 |
# Streamlit application layout
|
| 14 |
st.title("Financial News Analysis")
|
| 15 |
+
st.write("Analyze corresponding Topic and Trend for Financial News!")
|
| 16 |
st.image("./Fin.jpg", use_column_width = True)
|
| 17 |
|
| 18 |
# Text input for user to enter the text
|
|
|
|
| 29 |
max_score_1 = float('-inf')
|
| 30 |
max_label_1 = ''
|
| 31 |
|
| 32 |
+
for result_1 in results_1:
|
| 33 |
+
if result_1['score'] > max_score_1:
|
| 34 |
+
max_score_1 = result_1['score']
|
| 35 |
+
max_label_1 = result_1['label']
|
| 36 |
|
| 37 |
# Display the classification result
|
| 38 |
max_score_2 = float('-inf')
|
| 39 |
max_label_2 = ''
|
| 40 |
|
| 41 |
+
for result_2 in results_2:
|
| 42 |
+
if result_2['score'] > max_score_2:
|
| 43 |
+
max_score_2 = result_2['score']
|
| 44 |
+
max_label_2 = result_2['label']
|
| 45 |
|
| 46 |
st.write("Financial Text:", text)
|
| 47 |
st.write("Trend:", max_label_1)
|