Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,11 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Streamlit application title
|
| 7 |
st.title("Financial News Sentiment Analysis")
|
|
@@ -22,11 +26,7 @@ if st.button("Identify Sentiment"):
|
|
| 22 |
|
| 23 |
st.write(f"Sentiment: {sentiment_label}")
|
| 24 |
|
| 25 |
-
|
| 26 |
-
sentiment_label = 0
|
| 27 |
-
context = 0
|
| 28 |
-
question = 0
|
| 29 |
-
|
| 30 |
# Initialize the question-answering pipeline
|
| 31 |
qa_pipe = pipeline("question-answering", model="deepset/roberta-base-squad2")
|
| 32 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# set initial values to avoid empty
|
| 5 |
+
sentiment_label = 0
|
| 6 |
+
context = 0
|
| 7 |
+
question = 0
|
| 8 |
+
|
| 9 |
|
| 10 |
# Streamlit application title
|
| 11 |
st.title("Financial News Sentiment Analysis")
|
|
|
|
| 26 |
|
| 27 |
st.write(f"Sentiment: {sentiment_label}")
|
| 28 |
|
| 29 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# Initialize the question-answering pipeline
|
| 31 |
qa_pipe = pipeline("question-answering", model="deepset/roberta-base-squad2")
|
| 32 |
|