Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,8 @@ model_g = gensim.models.KeyedVectors.load_word2vec_format('v_glove_300d_2.0' , b
|
|
6 |
|
7 |
#retrieve the most similar words
|
8 |
|
9 |
-
def generate(
|
10 |
-
result= model_g.most_similar(
|
11 |
return result
|
12 |
|
13 |
|
@@ -18,7 +18,7 @@ examples = [
|
|
18 |
]
|
19 |
|
20 |
title = "Visually Grounded embeddings"
|
21 |
-
description = 'Get the top 10 nearest neighbors from a visually grounded word embedding model described in [this paper](https://arxiv.org/abs/2206.08823).<br>'
|
22 |
txt = gr.Textbox(lines=1, label="Query word", placeholder="muffin")
|
23 |
out = gr.Textbox(lines=4, label="top 10 nearest neighbors")
|
24 |
|
|
|
6 |
|
7 |
#retrieve the most similar words
|
8 |
|
9 |
+
def generate(word):
|
10 |
+
result= model_g.most_similar(word,topn=10)
|
11 |
return result
|
12 |
|
13 |
|
|
|
18 |
]
|
19 |
|
20 |
title = "Visually Grounded embeddings"
|
21 |
+
description = 'Get the top 10 nearest neighbors with cosine similarities from a visually grounded word embedding model described in [this paper](https://arxiv.org/abs/2206.08823).<br>'
|
22 |
txt = gr.Textbox(lines=1, label="Query word", placeholder="muffin")
|
23 |
out = gr.Textbox(lines=4, label="top 10 nearest neighbors")
|
24 |
|