jchen1234567 commited on
Commit
83d14c6
1 Parent(s): a4a28f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
 
5
 
6
  pipe_sent = pipeline("text-classification", model="ProsusAI/finbert")
7
- pipe_trans = pipeline("translation", model="Helsinki-NLP/opus-mt-mul-en")
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
- results = pipe_sent(pipe_trans(text))[0]
 
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')