roselyu commited on
Commit
47ba073
·
verified ·
1 Parent(s): 6726773

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -1,15 +1,12 @@
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")
12
- st.write("Identify the sentiment to help you make decisions.")
13
 
14
  # Load the summarization and sentiment analysis pipelines
15
 
@@ -42,7 +39,7 @@ else:
42
  question = "What's the opinion?"
43
 
44
  # Generate the answer
45
- result = qa_pipe(question=question, context=context)[0]["answer"]
46
 
47
  # Display different buttons based on sentiment
48
  if sentiment_label == "positive":
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+
 
 
 
5
 
6
 
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
  # Load the summarization and sentiment analysis pipelines
12
 
 
39
  question = "What's the opinion?"
40
 
41
  # Generate the answer
42
+ result = qa_pipe(question=question, context=context)["answer"]
43
 
44
  # Display different buttons based on sentiment
45
  if sentiment_label == "positive":