File size: 382 Bytes
d3b9b53
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import gradio as gr
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
model = SentenceTransformer('keithhon/paraphrase-multilingual-MiniLM-L12-v2')

def compute_similarity_score(name1, name2):
    return cos_sim(name1, name2)

iface = gr.Interface(fn=compute_similarity_score, inputs=["text","text"], outputs="text")
iface.launch()