Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,14 @@
|
|
1 |
import gensim
|
|
|
2 |
|
3 |
-
model = gensim.models.Word2Vec.load("w2v_model.model")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gensim
|
2 |
+
import gradio as gr
|
3 |
|
4 |
+
model = gensim.models.Word2Vec.load("w2v_model.model")
|
5 |
+
|
6 |
+
def most_sim(input):
|
7 |
+
sim_lst = model.wv.most_similar(input)
|
8 |
+
sim_str = ""
|
9 |
+
for tup in sim_lst:
|
10 |
+
sim_str = sim_str + tup + "\n"
|
11 |
+
return sim_str
|
12 |
+
|
13 |
+
demo = gr.Interface(fn=most_sim, inputs="text", outputs="text")
|
14 |
+
demo.launch()
|