Spaces:
Runtime error
Runtime error
Formatting output text
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def get_similarity(sentence_a, sentence_b):
|
|
16 |
embed_b = model([sentence_b])
|
17 |
print(embed_a.shape, embed_b.shape)
|
18 |
similarity = cosine_similarity(embed_a, embed_b)[0][0]
|
19 |
-
return f
|
20 |
|
21 |
iface = gr.Interface(fn=get_similarity,
|
22 |
inputs=[gr.Textbox(lines=2, placeholder="Sentence A here...", label="Sentence A"),
|
|
|
16 |
embed_b = model([sentence_b])
|
17 |
print(embed_a.shape, embed_b.shape)
|
18 |
similarity = cosine_similarity(embed_a, embed_b)[0][0]
|
19 |
+
return f'The similarity score between sentence A and sentence B is: "{similarity:.2f}"'
|
20 |
|
21 |
iface = gr.Interface(fn=get_similarity,
|
22 |
inputs=[gr.Textbox(lines=2, placeholder="Sentence A here...", label="Sentence A"),
|