Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,9 @@ if st.button("Guess") or word:
|
|
25 |
word_embedding = model.encode(word)
|
26 |
similarity = util.pytorch_cos_sim(secred_embedding, word_embedding).cpu().numpy()[0][0]
|
27 |
st.session_state['words'].append((word, similarity))
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
25 |
word_embedding = model.encode(word)
|
26 |
similarity = util.pytorch_cos_sim(secred_embedding, word_embedding).cpu().numpy()[0][0]
|
27 |
st.session_state['words'].append((word, similarity))
|
28 |
+
|
29 |
+
words_df = pd.DataFrame(
|
30 |
+
st.session_state['words'],
|
31 |
+
columns=["word", "similarity"]
|
32 |
+
).sort_values(by=["similarity"], ascending=False)
|
33 |
+
st.dataframe(words_df)
|