KatGaw commited on
Commit
4143184
1 Parent(s): a4b0c7b

ordering url links by date

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -19,9 +19,7 @@ st.image('el_pic.png')
19
 
20
  #@st.cache_resource
21
  if "messages" not in st.session_state:
22
- st.session_state["messages"] = [{"role":"system", "content":"""
23
- How can I help you?
24
- """}]
25
 
26
  # Display all previous messages
27
  for msg in st.session_state.messages:
@@ -30,7 +28,6 @@ for msg in st.session_state.messages:
30
  #initialize_session_state()
31
 
32
 
33
-
34
  sideb=st.sidebar
35
  with st.sidebar:
36
  prompt=st.text_input("Enter topic for sentiment analysis: ")
@@ -89,7 +86,13 @@ if check1:
89
  'Index':np.round(sentiment_analysis_result_reddit["Sentiment"][0]['score'],2)
90
  }
91
  analysis_results.append(np.append(result,np.append(article.split('URL:')[-1:], ((article.split('Date: ')[-1:])[0][0:10]))))
92
- #pd.DataFrame(analysis_results).to_csv('analysis_results.csv')
 
 
 
 
 
 
93
 
94
  #Generate summarized message rationalize dominant sentiment
95
  summary = sentiment_analysis_util.generate_summary_of_sentiment(analysis_results) #, dominant_sentiment)
 
19
 
20
  #@st.cache_resource
21
  if "messages" not in st.session_state:
22
+ st.session_state["messages"] = [{"role":"system", "content":"""💬 How can I help you?"""}]
 
 
23
 
24
  # Display all previous messages
25
  for msg in st.session_state.messages:
 
28
  #initialize_session_state()
29
 
30
 
 
31
  sideb=st.sidebar
32
  with st.sidebar:
33
  prompt=st.text_input("Enter topic for sentiment analysis: ")
 
86
  'Index':np.round(sentiment_analysis_result_reddit["Sentiment"][0]['score'],2)
87
  }
88
  analysis_results.append(np.append(result,np.append(article.split('URL:')[-1:], ((article.split('Date: ')[-1:])[0][0:10]))))
89
+ # print(analysis_results)
90
+ # import pandas as pd
91
+ # print('STOP')
92
+ # df_analysis_results=pd.DataFrame(analysis_results['News_Article'])
93
+ # print(df_analysis_results)
94
+ # df_analysis_results.sort_values(by='Date')
95
+ # df_analysis_results.to_csv('analysis_results.csv')
96
 
97
  #Generate summarized message rationalize dominant sentiment
98
  summary = sentiment_analysis_util.generate_summary_of_sentiment(analysis_results) #, dominant_sentiment)