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() |