Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,6 @@ from transformers import pipeline
|
|
| 7 |
# Streamlit application title
|
| 8 |
st.title("Financial News Sentiment Analysis")
|
| 9 |
st.write("Identify the sentiment and look into the key point to help you make decisions.")
|
| 10 |
-
st.write("(Please ignore any errors shown before you enter a valid input)")
|
| 11 |
|
| 12 |
|
| 13 |
# Load the summarization and sentiment analysis pipelines
|
|
@@ -15,7 +14,10 @@ st.write("(Please ignore any errors shown before you enter a valid input)")
|
|
| 15 |
pipe = pipeline("text-classification", model="roselyu/FinSent-XLMR-FinNews")
|
| 16 |
|
| 17 |
# User input and sentiment analysis
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
| 19 |
sentiment_label = pipe(user_input)[0]["label"]
|
| 20 |
|
| 21 |
# Summarize and identify sentiment button
|
|
|
|
| 7 |
# Streamlit application title
|
| 8 |
st.title("Financial News Sentiment Analysis")
|
| 9 |
st.write("Identify the sentiment and look into the key point to help you make decisions.")
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
# Load the summarization and sentiment analysis pipelines
|
|
|
|
| 14 |
pipe = pipeline("text-classification", model="roselyu/FinSent-XLMR-FinNews")
|
| 15 |
|
| 16 |
# User input and sentiment analysis
|
| 17 |
+
default_summary = "Enter a financial news summary here"
|
| 18 |
+
user_input = st.text_area("Enter a short financial news article to identify its sentiments:", value=default_summary)
|
| 19 |
+
|
| 20 |
+
|
| 21 |
sentiment_label = pipe(user_input)[0]["label"]
|
| 22 |
|
| 23 |
# Summarize and identify sentiment button
|