Sirinoot commited on
Commit
382dab4
·
verified ·
1 Parent(s): f6a46b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -9
app.py CHANGED
@@ -156,15 +156,6 @@ def predict_test(model, tokenizer, embedding_model, df, question, index): # sen
156
  mostSimContext = re.sub(r'\s+', ' ', mostSimContext)
157
 
158
  segments = sent_tokenize(mostSimContext, engine="crfcut")
159
-
160
- #=====add
161
- if (len(segments)==1):
162
- segments = ' '.join(segments)
163
-
164
- segments = segments.split('และ')
165
- segments = [segment.split('หรือ') for segment in segments]
166
- segments = [sentence for segment in segments for sentence in segment]
167
- #=====end
168
 
169
  segments_index = set_index(get_embeddings(embedding_model,segments))
170
  _distances,_indices = faiss_search(segments_index, question_vector)
 
156
  mostSimContext = re.sub(r'\s+', ' ', mostSimContext)
157
 
158
  segments = sent_tokenize(mostSimContext, engine="crfcut")
 
 
 
 
 
 
 
 
 
159
 
160
  segments_index = set_index(get_embeddings(embedding_model,segments))
161
  _distances,_indices = faiss_search(segments_index, question_vector)