Spaces:
Sleeping
Sleeping
Ask for help extension
Browse files
app.py
CHANGED
@@ -298,6 +298,10 @@ if st.session_state.actions[-1] == 'cue':
|
|
298 |
write_bot('What do you want to see?', remember=False, blink=False)
|
299 |
|
300 |
while guessed == False:
|
|
|
|
|
|
|
|
|
301 |
col1, col2, col3, col4 = st.columns(4)
|
302 |
col5, col6, col7 = st.columns(3)
|
303 |
|
@@ -307,13 +311,10 @@ if st.session_state.actions[-1] == 'cue':
|
|
307 |
b2 = st.button("Related words")
|
308 |
with col3:
|
309 |
b3 = st.button("Next word", key="2")
|
310 |
-
|
311 |
with col4:
|
312 |
b4 = st.button("All words", key="3")
|
313 |
|
314 |
# JS
|
315 |
-
word_count = st.session_state.counters["word_count"]
|
316 |
-
target = st.session_state.results["results"][word_count]
|
317 |
#if get_available_cues(target):
|
318 |
# avail_cues = get_available_cues(target)
|
319 |
#cues_buttons = {cue_type: st.button(cue_type) for cue_type in avail_cues}
|
@@ -328,9 +329,15 @@ if st.session_state.actions[-1] == 'cue':
|
|
328 |
|
329 |
if b1:
|
330 |
st.session_state.counters["letter_count"] += 1
|
331 |
-
word_count = st.session_state.counters["word_count"]
|
332 |
letter_count = st.session_state.counters["letter_count"]
|
333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
|
335 |
elif b2:
|
336 |
rels = return_top_k(st.session_state.descriptions[-1], word=target, rels=True)
|
|
|
298 |
write_bot('What do you want to see?', remember=False, blink=False)
|
299 |
|
300 |
while guessed == False:
|
301 |
+
# JS
|
302 |
+
word_count = st.session_state.counters["word_count"]
|
303 |
+
target = st.session_state.results["results"][word_count]
|
304 |
+
|
305 |
col1, col2, col3, col4 = st.columns(4)
|
306 |
col5, col6, col7 = st.columns(3)
|
307 |
|
|
|
311 |
b2 = st.button("Related words")
|
312 |
with col3:
|
313 |
b3 = st.button("Next word", key="2")
|
|
|
314 |
with col4:
|
315 |
b4 = st.button("All words", key="3")
|
316 |
|
317 |
# JS
|
|
|
|
|
318 |
#if get_available_cues(target):
|
319 |
# avail_cues = get_available_cues(target)
|
320 |
#cues_buttons = {cue_type: st.button(cue_type) for cue_type in avail_cues}
|
|
|
329 |
|
330 |
if b1:
|
331 |
st.session_state.counters["letter_count"] += 1
|
332 |
+
#word_count = st.session_state.counters["word_count"]
|
333 |
letter_count = st.session_state.counters["letter_count"]
|
334 |
+
if letter_count < len(target):
|
335 |
+
write_bot(f'The word starts with {st.session_state.results["results"][word_count][:letter_count]}', remember=False)
|
336 |
+
ask_if_helped()
|
337 |
+
else:
|
338 |
+
write_bot(f'This is my predicted word: "{target}". Does this match your query?')
|
339 |
+
ask_if_helped()
|
340 |
+
|
341 |
|
342 |
elif b2:
|
343 |
rels = return_top_k(st.session_state.descriptions[-1], word=target, rels=True)
|