Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
84 |
-
|
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
|
307 |
-
col5, col6, col7, col8, col9
|
308 |
|
309 |
with col1:
|
310 |
b1 = st.button("Next letter", key="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, 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")
|