Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ access = "hf_"
|
|
5 |
token = "hhbFNpjKohezoexWMlyPUpvJQLWlaFhJaa"
|
6 |
|
7 |
# Load the text classification model pipeline
|
8 |
-
analysis = pipeline("text-classification", model='ZephyruSalsify/
|
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="♕")
|
@@ -24,24 +24,6 @@ if st.button("Analyze"):
|
|
24 |
# Perform text analysis on the input text
|
25 |
results_1 = analysis(text)[0]
|
26 |
results_2 = classification(text)[0]
|
27 |
-
|
28 |
-
# Display the analysis result
|
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:", results_1["label"])
|
|
|
5 |
token = "hhbFNpjKohezoexWMlyPUpvJQLWlaFhJaa"
|
6 |
|
7 |
# Load the text classification model pipeline
|
8 |
+
analysis = pipeline("text-classification", model='ZephyruSalsify/FinNews_SentimentAnalysis')
|
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="♕")
|
|
|
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:", results_1["label"])
|