Bofandra commited on
Commit
45fde58
1 Parent(s): 69e5f39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -16,16 +16,18 @@ def find(query):
16
  quran = pd.read_csv('quran-simple-clean.txt', delimiter="|")
17
  file = open('encoded_quran_text_split_multilingual-e5-large-instruct.sav','rb')
18
  document_embeddings = pickle.load(file)
19
-
20
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
21
  query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
22
  scores = (query_embeddings @ document_embeddings.T) * 100
 
23
 
24
  # insert the similarity value to dataframe & sort it
25
  file = open('quran-splitted.sav','rb')
26
  quran_splitted = pickle.load(file)
27
  quran_splitted['similarity'] = scores.tolist()[0]
28
  sorted_quran = quran_splitted.sort_values(by='similarity', ascending=False)
 
29
 
30
  results = ""
31
  i = 0
 
16
  quran = pd.read_csv('quran-simple-clean.txt', delimiter="|")
17
  file = open('encoded_quran_text_split_multilingual-e5-large-instruct.sav','rb')
18
  document_embeddings = pickle.load(file)
19
+ print("cekpoin1\n")
20
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
21
  query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
22
  scores = (query_embeddings @ document_embeddings.T) * 100
23
+ print("cekpoin2\n")
24
 
25
  # insert the similarity value to dataframe & sort it
26
  file = open('quran-splitted.sav','rb')
27
  quran_splitted = pickle.load(file)
28
  quran_splitted['similarity'] = scores.tolist()[0]
29
  sorted_quran = quran_splitted.sort_values(by='similarity', ascending=False)
30
+ print("cekpoin3\n")
31
 
32
  results = ""
33
  i = 0