Muhammad Haris commited on
Commit
82847bf
·
verified ·
1 Parent(s): c200bf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -3,11 +3,17 @@ import wna_googlenews as wna
3
  import pandas as pd
4
  from transformers import pipeline
5
 
6
- st.set_page_config(layout="wide")
7
 
8
  st.title("Google News LLM")
9
 
10
- query = st.text_input("Search for news")
 
 
 
 
 
 
11
 
12
  models = [
13
  "j-hartmann/emotion-english-distilroberta-base",
@@ -49,7 +55,7 @@ if st.button("Search"):
49
  # display a loading progress
50
  with st.spinner("Loading last news ..."):
51
  allnews = wna.get_news(settings, query)
52
- # st.dataframe(allnews)
53
  with st.spinner("Processing received news ..."):
54
  df = pd.DataFrame(columns=["sentence", "date","best","second"])
55
  # loop on each sentence and call classifier
 
3
  import pandas as pd
4
  from transformers import pipeline
5
 
6
+ st.set_page_config(layout="wide",page_title="News Inferno",page_icon="🌍")
7
 
8
  st.title("Google News LLM")
9
 
10
+ # Store the initial value of widgets in session state
11
+ if "placeholder" not in st.session_state:
12
+ st.session_state.placeholder = "Enter your search query here"
13
+
14
+ # Display the text input widget with dynamic placeholder
15
+ query = st.text_input("Search for news",
16
+ placeholder=st.session_state.placeholder)
17
 
18
  models = [
19
  "j-hartmann/emotion-english-distilroberta-base",
 
55
  # display a loading progress
56
  with st.spinner("Loading last news ..."):
57
  allnews = wna.get_news(settings, query)
58
+ st.dataframe(allnews)
59
  with st.spinner("Processing received news ..."):
60
  df = pd.DataFrame(columns=["sentence", "date","best","second"])
61
  # loop on each sentence and call classifier