Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,10 @@ import pickle
|
|
3 |
from sentence_transformers import SentenceTransformer
|
4 |
import pandas as pd
|
5 |
|
6 |
-
def
|
7 |
# transform query from user
|
8 |
model = SentenceTransformer('use-cmlm-multilingual')
|
9 |
-
encoded_query_text = model.encode(
|
10 |
|
11 |
# get encoded quran text
|
12 |
file = open('encoded_quran_cmlm.sav','rb')
|
@@ -28,9 +28,9 @@ def greet(name):
|
|
28 |
sorted_quran = quran.sort_values(by='similarity', ascending=False)
|
29 |
df_list = sorted_quran.values.tolist()
|
30 |
|
31 |
-
return df_list['text']
|
32 |
|
33 |
-
demo = gr.Interface(fn=
|
34 |
|
35 |
if __name__ == "__main__":
|
36 |
demo.launch()
|
|
|
3 |
from sentence_transformers import SentenceTransformer
|
4 |
import pandas as pd
|
5 |
|
6 |
+
def find(query):
|
7 |
# transform query from user
|
8 |
model = SentenceTransformer('use-cmlm-multilingual')
|
9 |
+
encoded_query_text = model.encode(query)
|
10 |
|
11 |
# get encoded quran text
|
12 |
file = open('encoded_quran_cmlm.sav','rb')
|
|
|
28 |
sorted_quran = quran.sort_values(by='similarity', ascending=False)
|
29 |
df_list = sorted_quran.values.tolist()
|
30 |
|
31 |
+
return df_list['text']
|
32 |
|
33 |
+
demo = gr.Interface(fn=find, inputs="textbox", outputs="textbox")
|
34 |
|
35 |
if __name__ == "__main__":
|
36 |
demo.launch()
|