Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -166,7 +166,7 @@ def predict_test(model, tokenizer, embedding_model, df, question, index): # sen
|
|
166 |
segment_embeddings = prepare_sentences_vector(segment_embeddings)
|
167 |
segment_index = create_segment_index(segment_embeddings)
|
168 |
|
169 |
-
_distances,_indices = faiss_search(
|
170 |
mostSimSegment = segments[_indices[0][0]]
|
171 |
|
172 |
Answer = model_pipeline(model, tokenizer,question,mostSimSegment)
|
@@ -216,12 +216,12 @@ def chat_interface_after(question, history):
|
|
216 |
return highlighted_answer
|
217 |
|
218 |
examples=[
|
|
|
|
|
|
|
219 |
'อยากทราบความถี่ในการดึงข้อมูลของ DXT360 ในแต่ละแพลตฟอร์ม',
|
220 |
'อยากทราบความถี่ในการดึงข้อมูลของ DXT360 บน Twitter',
|
221 |
'ช่องทางติดตามข่าวสารของเรา',
|
222 |
-
'ขอช่องทางติดตามข่าวสารทาง Line หน่อย',
|
223 |
-
'ช่องทางติดตามข่าวสารของเรา',
|
224 |
-
'ขอช่องทางติดตามข่าวสารทาง Line หน่อย',
|
225 |
]
|
226 |
demo_before = gr.ChatInterface(fn=chat_interface_before,
|
227 |
examples=examples)
|
|
|
166 |
segment_embeddings = prepare_sentences_vector(segment_embeddings)
|
167 |
segment_index = create_segment_index(segment_embeddings)
|
168 |
|
169 |
+
_distances,_indices = faiss_search(segment_index, question_vector)
|
170 |
mostSimSegment = segments[_indices[0][0]]
|
171 |
|
172 |
Answer = model_pipeline(model, tokenizer,question,mostSimSegment)
|
|
|
216 |
return highlighted_answer
|
217 |
|
218 |
examples=[
|
219 |
+
'ขอเลขที่บัญชีของบริษัทหน่อย',
|
220 |
+
'บริษัทตั้งอยู่ที่ถนนอะไร,
|
221 |
+
'ขอช่องทางติดตามข่าวสารทาง Line หน่อย',
|
222 |
'อยากทราบความถี่ในการดึงข้อมูลของ DXT360 ในแต่ละแพลตฟอร์ม',
|
223 |
'อยากทราบความถี่ในการดึงข้อมูลของ DXT360 บน Twitter',
|
224 |
'ช่องทางติดตามข่าวสารของเรา',
|
|
|
|
|
|
|
225 |
]
|
226 |
demo_before = gr.ChatInterface(fn=chat_interface_before,
|
227 |
examples=examples)
|