keithhon commited on
Commit
1dad570
1 Parent(s): a5fb7a4

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from sentence_transformers import SentenceTransformer
3
+ from sentence_transformers.util import cos_sim
4
+ model = SentenceTransformer('keithhon/paraphrase-multilingual-MiniLM-L12-v2')
5
+
6
+ def compute_similarity_score(name1, name2):
7
+ return cos_sim(model.encode(name1), model.encode(name2)).tolist()[0]
8
+
9
+ iface = gr.Interface(fn=compute_similarity_score, inputs=["text","text"], outputs="text")
10
+ iface.launch()