NursNurs commited on
Commit
dda46f5
·
1 Parent(s): 93a8ff8

Changed the buttons position

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -78,10 +78,10 @@ def return_top_k(sentence, k=10, word=None, rels=False):
78
  predictions = [tokenizer.decode(tokens, skip_special_tokens=True) for tokens in output_sequences['sequences']]
79
  probabilities = [round(float(prob), 2) for prob in decoded_probabilities]
80
 
81
- # stripped_sent = [remove_punctuation(word.lower()) for word in sentence.split()]
82
- # for pred in predictions:
83
- # if (len(pred) < 2) | (pred in stripped_sent):
84
- # predictions.pop(predictions.index(pred))
85
 
86
  return predictions[:10]
87
 
@@ -303,8 +303,8 @@ if st.session_state.actions[-1] == 'cue':
303
  word_count = st.session_state.counters["word_count"]
304
  target = st.session_state.results["results"][word_count]
305
 
306
- col1, col2, col3, col4, col11, col12 = st.columns(6)
307
- col5, col6, col7, col8, col9 = st.columns(5)
308
 
309
  with col1:
310
  b1 = st.button("Next letter", key="1")
@@ -320,13 +320,9 @@ if st.session_state.actions[-1] == 'cue':
320
  # avail_cues = get_available_cues(target)
321
  #cues_buttons = {cue_type: st.button(cue_type) for cue_type in avail_cues}
322
 
323
- with col5:
324
- b5 = st.button("I remembered the word!", key="4", type='primary')
325
- with col6:
326
- b6 = st.button("Exit", key="5", type='primary')
327
-
328
- with col7:
329
- new = st.button('Play again', key=64)
330
 
331
  if b1:
332
  st.session_state.counters["letter_count"] += 1
 
78
  predictions = [tokenizer.decode(tokens, skip_special_tokens=True) for tokens in output_sequences['sequences']]
79
  probabilities = [round(float(prob), 2) for prob in decoded_probabilities]
80
 
81
+ stripped_sent = [remove_punctuation(word.lower()) for word in sentence.split()]
82
+ for pred in predictions:
83
+ if (len(pred) < 2) | (pred in stripped_sent):
84
+ predictions.pop(predictions.index(pred))
85
 
86
  return predictions[:10]
87
 
 
303
  word_count = st.session_state.counters["word_count"]
304
  target = st.session_state.results["results"][word_count]
305
 
306
+ col1, col2, col3, col4, col5 = st.columns(5)
307
+
308
 
309
  with col1:
310
  b1 = st.button("Next letter", key="1")
 
320
  # avail_cues = get_available_cues(target)
321
  #cues_buttons = {cue_type: st.button(cue_type) for cue_type in avail_cues}
322
 
323
+ b5 = st.button("I remembered the word!", key="4", type='primary')
324
+ b6 = st.button("Exit", key="5", type='primary')
325
+ new = st.button('Play again', key=64)
 
 
 
 
326
 
327
  if b1:
328
  st.session_state.counters["letter_count"] += 1