Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,13 +21,23 @@ text = st.text_area("Enter the Financial News", "")
|
|
| 21 |
# Perform text classification when the user clicks the "Classify" button
|
| 22 |
if st.button("Analyze"):
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
# Perform text analysis on the input text
|
| 25 |
results_1 = analysis(text)[0]
|
| 26 |
results_2 = classification(text)[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
st.write("Financial Text:", text)
|
| 29 |
-
st.write("Trend:",
|
| 30 |
-
st.write("Trend_Score:",
|
| 31 |
|
| 32 |
-
st.write("Finance Topic:",
|
| 33 |
-
st.write("Topic_Score:",
|
|
|
|
| 21 |
# Perform text classification when the user clicks the "Classify" button
|
| 22 |
if st.button("Analyze"):
|
| 23 |
|
| 24 |
+
label_1 = ""
|
| 25 |
+
score_1 = 0.0
|
| 26 |
+
label_2 = ""
|
| 27 |
+
score_2 = 0.0
|
| 28 |
+
|
| 29 |
# Perform text analysis on the input text
|
| 30 |
results_1 = analysis(text)[0]
|
| 31 |
results_2 = classification(text)[0]
|
| 32 |
+
|
| 33 |
+
label_1 = results_1["label"]
|
| 34 |
+
score_1 = results_1["score"]
|
| 35 |
+
label_2 = results_2["label"]
|
| 36 |
+
score_2 = results_2["score"]
|
| 37 |
|
| 38 |
st.write("Financial Text:", text)
|
| 39 |
+
st.write("Trend:", label_1)
|
| 40 |
+
st.write("Trend_Score:", score_1)
|
| 41 |
|
| 42 |
+
st.write("Finance Topic:", label_2)
|
| 43 |
+
st.write("Topic_Score:", rscore_2)
|