schlenker commited on
Commit
e8da674
·
1 Parent(s): f895ed9

helpful state

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -330,15 +330,18 @@ if st.session_state.actions[-1] == 'cue':
330
  letter_count = st.session_state.counters["letter_count"]
331
  if letter_count < len(target):
332
  write_bot(f'The word starts with {st.session_state.results["results"][word_count][:letter_count]}. \n Does this help you remember the word?', remember=False)
333
- ask_if_helped()
 
334
  else:
335
  write_bot(f'This is my predicted word: "{target}". Does this match your query?')
336
- ask_if_helped()
 
337
 
338
  elif b2:
339
  rels = return_top_k(st.session_state.descriptions[-1], word=target, rels=True)
340
  write_bot(f'Here are words that are related to your word: {", ".join(rels)}. \n Does this help you remember the word?', remember=False)
341
- ask_if_helped()
 
342
 
343
  elif b3:
344
  st.session_state.counters["letter_count"] = 1
@@ -348,10 +351,12 @@ if st.session_state.actions[-1] == 'cue':
348
  #write_bot(f'The next word starts with {st.session_state.results["results"][word_count][:letter_count]}', remember=False)
349
  if letter_count < len(target):
350
  write_bot(f'The next word starts with {st.session_state.results["results"][word_count][:letter_count]}. \n Does this help you remember the word?', remember=False)
351
- ask_if_helped()
 
352
  else:
353
  write_bot(f'This is my predicted word: "{target}". Does this match your query?')
354
- ask_if_helped()
 
355
 
356
  #elif get_available_cues(target) and "Synonyms" in cues_buttons and cues_buttons['Synonyms']:
357
  #write_bot(f'Here are synonyms for the current word: {", ".join(avail_cues["Synonyms"])}', remember=False)
@@ -372,9 +377,9 @@ if st.session_state.actions[-1] == 'cue':
372
  write_bot("Yay! I am happy I could be of help!")
373
  st.session_state.counters["word_count"] = 0
374
  st.session_state.counters["letter_count"] = 0
375
- #new = st.button('Play again', key=63)
376
- #if new:
377
- #write_bot("Please describe your word!")
378
  guessed = True
379
 
380
  break
 
330
  letter_count = st.session_state.counters["letter_count"]
331
  if letter_count < len(target):
332
  write_bot(f'The word starts with {st.session_state.results["results"][word_count][:letter_count]}. \n Does this help you remember the word?', remember=False)
333
+ #ask_if_helped()
334
+ st.session_state.is_helpful['ask'] = True
335
  else:
336
  write_bot(f'This is my predicted word: "{target}". Does this match your query?')
337
+ #ask_if_helped()
338
+ st.session_state.is_helpful['ask'] = True
339
 
340
  elif b2:
341
  rels = return_top_k(st.session_state.descriptions[-1], word=target, rels=True)
342
  write_bot(f'Here are words that are related to your word: {", ".join(rels)}. \n Does this help you remember the word?', remember=False)
343
+ #ask_if_helped()
344
+ st.session_state.is_helpful['ask'] = True
345
 
346
  elif b3:
347
  st.session_state.counters["letter_count"] = 1
 
351
  #write_bot(f'The next word starts with {st.session_state.results["results"][word_count][:letter_count]}', remember=False)
352
  if letter_count < len(target):
353
  write_bot(f'The next word starts with {st.session_state.results["results"][word_count][:letter_count]}. \n Does this help you remember the word?', remember=False)
354
+ #ask_if_helped()
355
+ st.session_state.is_helpful['ask'] = True
356
  else:
357
  write_bot(f'This is my predicted word: "{target}". Does this match your query?')
358
+ #ask_if_helped()
359
+ st.session_state.is_helpful['ask'] = True
360
 
361
  #elif get_available_cues(target) and "Synonyms" in cues_buttons and cues_buttons['Synonyms']:
362
  #write_bot(f'Here are synonyms for the current word: {", ".join(avail_cues["Synonyms"])}', remember=False)
 
377
  write_bot("Yay! I am happy I could be of help!")
378
  st.session_state.counters["word_count"] = 0
379
  st.session_state.counters["letter_count"] = 0
380
+ new = st.button('Play again', key=63)
381
+ if new:
382
+ write_bot("Please describe your word!")
383
  guessed = True
384
 
385
  break