Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -116,16 +116,14 @@ def semantic_search(query):
|
|
| 116 |
print(scores.index(min(scores)))
|
| 117 |
most_similar_doc = combined_list[scores.index(min(scores))]
|
| 118 |
print("Most similar document", most_similar_doc)
|
| 119 |
-
|
|
|
|
| 120 |
|
| 121 |
output = semantic_search("لذهب بعشرة آلاف دولار؟")
|
| 122 |
|
| 123 |
-
ranked = sorted(output, key=lambda x: x[1])
|
| 124 |
-
ranked[:3]
|
| 125 |
|
| 126 |
import gradio as gr
|
| 127 |
|
| 128 |
demo = gr.Interface(fn=semantic_search,inputs = ["text"], outputs=["text", "text", "text"])
|
| 129 |
if __name__ == "__main__":
|
| 130 |
demo.launch()
|
| 131 |
-
|
|
|
|
| 116 |
print(scores.index(min(scores)))
|
| 117 |
most_similar_doc = combined_list[scores.index(min(scores))]
|
| 118 |
print("Most similar document", most_similar_doc)
|
| 119 |
+
ranked = sorted(ls1, key=lambda x: x[1])
|
| 120 |
+
return ranked[0], ranked[1], ranked[2]
|
| 121 |
|
| 122 |
output = semantic_search("لذهب بعشرة آلاف دولار؟")
|
| 123 |
|
|
|
|
|
|
|
| 124 |
|
| 125 |
import gradio as gr
|
| 126 |
|
| 127 |
demo = gr.Interface(fn=semantic_search,inputs = ["text"], outputs=["text", "text", "text"])
|
| 128 |
if __name__ == "__main__":
|
| 129 |
demo.launch()
|
|
|