fixing some bugs and improving the prompt
Browse files- app.py +4 -2
- utils/haystack.py +15 -5
- utils/ui.py +1 -1
app.py
CHANGED
@@ -16,10 +16,12 @@ st.write("# 🐤 What have they been tweeting about lately?")
|
|
16 |
search_bar, button = st.columns(2)
|
17 |
# Search bar
|
18 |
with search_bar:
|
19 |
-
username = st.text_input("
|
20 |
|
21 |
with button:
|
22 |
-
|
|
|
|
|
23 |
|
24 |
run_query = (
|
25 |
run_pressed or username != st.session_state.username
|
|
|
16 |
search_bar, button = st.columns(2)
|
17 |
# Search bar
|
18 |
with search_bar:
|
19 |
+
username = st.text_input("Please provide a twitter username", on_change=reset_results)
|
20 |
|
21 |
with button:
|
22 |
+
st.write("")
|
23 |
+
st.write("")
|
24 |
+
run_pressed = st.button("Search tweets")
|
25 |
|
26 |
run_query = (
|
27 |
run_pressed or username != st.session_state.username
|
utils/haystack.py
CHANGED
@@ -16,18 +16,28 @@ def start_haystack():
|
|
16 |
|
17 |
Examples:
|
18 |
|
19 |
-
Twitter stream:
|
20 |
-
RT @deepset_ai:
|
|
|
|
|
21 |
|
22 |
-
Summary: This
|
|
|
23 |
|
24 |
Twitter stream: I've directed my team to set sharper rules on how we deal with unidentified objects.\n\nWe will inventory, improve ca…
|
25 |
the incursion by China’s high-altitude balloon, we enhanced radar to pick up slower objects.\n \nBy doing so, w…
|
26 |
I gave an update on the United States’ response to recent aerial objects.
|
27 |
|
28 |
-
Summary: This
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
|
|
|
|
|
|
31 |
Twitter stream: $tweets
|
32 |
|
33 |
Summary:
|
|
|
16 |
|
17 |
Examples:
|
18 |
|
19 |
+
Twitter stream: RT @deepset_ai: Come join our Haystack server for our first Discord event tomorrow, a deepset AMA session with @rusic_milos @malte_pietsch…
|
20 |
+
RT @deepset_ai: Join us for a chat! On Thursday 25th we are hosting a 'deepset - Ask Me Anything' session on our brand new Discord. Come…
|
21 |
+
RT @deepset_ai: Curious about how you can use @OpenAI GPT3 in a Haystack pipeline? This week we released Haystack 1.7 with which we introdu…
|
22 |
+
RT @tuanacelik: So many updates from @deepset_ai today!
|
23 |
|
24 |
+
Summary: This user has lately been retweeting tweets fomr @deepset_ai. The topics of the tweets have been around the Haystack community, NLP and GPT. They've
|
25 |
+
been posting in English, and have had a positive, informative tone.
|
26 |
|
27 |
Twitter stream: I've directed my team to set sharper rules on how we deal with unidentified objects.\n\nWe will inventory, improve ca…
|
28 |
the incursion by China’s high-altitude balloon, we enhanced radar to pick up slower objects.\n \nBy doing so, w…
|
29 |
I gave an update on the United States’ response to recent aerial objects.
|
30 |
|
31 |
+
Summary: This user has lately been tweeting about having sharper rules to deal with unidentified objects and an incursuin by China's high-altitude
|
32 |
+
baloon. Their tweets have mostly been neutral but determined in tone. They mostly post in English.
|
33 |
+
|
34 |
+
Twitter stream: here are some stats from Invisible Women -- lots more where that came from https://t.co/STCkyD1spwstay at home mums are not economically inactive,
|
35 |
+
YOUR CHANCE TO COMMENT ON A NEW BRITISH STANDARD FOR MENSTRUAL AND MENOPAUSAL HEALTH IN THE WORKPLACE
|
36 |
+
very attacked by South Dakota rn. @CCriadoPerez: The Invisible Women newsletter is BACK. Populist drivel for the modern woman. Also! Alzheimer’s and HRT. And POPPY. Enjoy…..
|
37 |
|
38 |
+
Summary: This user has lately been posting about the womens rights, menstrual and menopausal helpth and The Invisible Women newsletter. They've mostly been posting in English
|
39 |
+
and have a positive and informative tone.
|
40 |
+
|
41 |
Twitter stream: $tweets
|
42 |
|
43 |
Summary:
|
utils/ui.py
CHANGED
@@ -9,4 +9,4 @@ def set_initial_state():
|
|
9 |
set_state_if_absent("result", None)
|
10 |
|
11 |
def reset_results(*args):
|
12 |
-
st.session_state.
|
|
|
9 |
set_state_if_absent("result", None)
|
10 |
|
11 |
def reset_results(*args):
|
12 |
+
st.session_state.result = None
|