Commit
·
25d06af
1
Parent(s):
a9e8d85
Update app.py
Browse files
app.py
CHANGED
@@ -115,6 +115,7 @@ def clasifica_conv_americana(example):
|
|
115 |
return {i["label"]: float(i["score"]) for i in results}
|
116 |
|
117 |
def similitud(example,example2):
|
|
|
118 |
#Compute embedding for both lists
|
119 |
embeddings1 = model.encode(sentences1, convert_to_tensor=True)
|
120 |
embeddings2 = model.encode(sentences2, convert_to_tensor=True)
|
@@ -147,6 +148,6 @@ output_txt= gr.outputs.Textbox(label="Porcentaje de similitud:")
|
|
147 |
|
148 |
#iface = gr.Interface(fn=process, inputs=input_sen, outputs=["highlight","label","label"], examples=examples, title=title, description = description)
|
149 |
|
150 |
-
iface = gr.Interface(fn=process, inputs=[input_sen, input_sen2], outputs=["highlight",output_lbl2,output_lbl2,output_txt], examples=examples, title=title, description = description)
|
151 |
|
152 |
iface.launch()
|
|
|
115 |
return {i["label"]: float(i["score"]) for i in results}
|
116 |
|
117 |
def similitud(example,example2):
|
118 |
+
model = SentenceTransformer("hackathon-pln-es/jurisbert-tsdae-sentence-transformer")
|
119 |
#Compute embedding for both lists
|
120 |
embeddings1 = model.encode(sentences1, convert_to_tensor=True)
|
121 |
embeddings2 = model.encode(sentences2, convert_to_tensor=True)
|
|
|
148 |
|
149 |
#iface = gr.Interface(fn=process, inputs=input_sen, outputs=["highlight","label","label"], examples=examples, title=title, description = description)
|
150 |
|
151 |
+
iface = gr.Interface(fn=process, inputs=[input_sen, input_sen2], outputs=["highlight",output_lbl2,output_lbl2,output_txt], examples=[examples,examples2], title=title, description = description)
|
152 |
|
153 |
iface.launch()
|