JoanParanoid commited on
Commit
566d077
·
verified ·
1 Parent(s): c1e508c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import streamlit as st
2
  from transformers import pipeline
 
3
 
4
  access = "hf_"
5
  token = "hhbFNpjKohezoexWMlyPUpvJQLWlaFhJaa"
@@ -13,7 +14,7 @@ st.set_page_config(page_title="Financial News Analysis", page_icon="♕")
13
  # Streamlit application layout
14
  st.title("Financial News Analysis")
15
  st.write("Analyze corresponding Topic and Trend for Financial News!")
16
- st.image("./Fin.jpg", use_column_width = True)
17
 
18
  # Text input for user to enter the text
19
  text = st.text_area("Enter the Financial News", "")
@@ -23,7 +24,7 @@ score_1 = 0.0
23
  label_2 = ""
24
  score_2 = 0.0
25
 
26
- if st.button("Analyze"):
27
  # Perform text analysis on the input text
28
  results_1 = analysis(text)[0]
29
  results_2 = classification(text)[0]
@@ -40,3 +41,4 @@ st.write("Trend_Score:", score_1)
40
 
41
  st.write("Finance Topic:", label_2)
42
  st.write("Topic_Score:", score_2)
 
 
1
  import streamlit as st
2
  from transformers import pipeline
3
+ import time
4
 
5
  access = "hf_"
6
  token = "hhbFNpjKohezoexWMlyPUpvJQLWlaFhJaa"
 
14
  # Streamlit application layout
15
  st.title("Financial News Analysis")
16
  st.write("Analyze corresponding Topic and Trend for Financial News!")
17
+ st.image("./Fin.jpg", use_column_width=True)
18
 
19
  # Text input for user to enter the text
20
  text = st.text_area("Enter the Financial News", "")
 
24
  label_2 = ""
25
  score_2 = 0.0
26
 
27
+ if st.button("Analyze_" + str(time.time())): # Using time stamp as a unique key
28
  # Perform text analysis on the input text
29
  results_1 = analysis(text)[0]
30
  results_2 = classification(text)[0]
 
41
 
42
  st.write("Finance Topic:", label_2)
43
  st.write("Topic_Score:", score_2)
44
+