Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
|
|
4 |
|
5 |
|
6 |
pipe_sent = pipeline("text-classification", model="ProsusAI/finbert")
|
7 |
-
|
8 |
|
9 |
# Streamlit application title
|
10 |
st.title("FinSentinel-Portuguese Financial Sentiment Analysis")
|
@@ -16,7 +16,8 @@ text = st.text_area("Enter the text to classify", "")
|
|
16 |
# Perform text classification when the user clicks the "Classify" button
|
17 |
if st.button("Classify"):
|
18 |
# Perform text classification on the input text
|
19 |
-
|
|
|
20 |
|
21 |
# Display the classification result
|
22 |
max_score = float('-inf')
|
|
|
4 |
|
5 |
|
6 |
pipe_sent = pipeline("text-classification", model="ProsusAI/finbert")
|
7 |
+
pipe_tran = pipeline("translation", model="Helsinki-NLP/opus-mt-mul-en")
|
8 |
|
9 |
# Streamlit application title
|
10 |
st.title("FinSentinel-Portuguese Financial Sentiment Analysis")
|
|
|
16 |
# Perform text classification when the user clicks the "Classify" button
|
17 |
if st.button("Classify"):
|
18 |
# Perform text classification on the input text
|
19 |
+
translated_text = pipe_trans(text_input)[0]['translation_text']
|
20 |
+
results = pipe_sent(translated_text)[0]
|
21 |
|
22 |
# Display the classification result
|
23 |
max_score = float('-inf')
|