Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ def predict_bm25(service):
|
|
| 23 |
|
| 24 |
sorted_local_names = np.array([b25local_names[i] for i in sorted_doc_indices])
|
| 25 |
scores = doc_scores[sorted_doc_indices]
|
| 26 |
-
scores_filtered = np.argwhere(scores>
|
| 27 |
filtered_local_names = sorted_local_names[scores_filtered.tolist()].tolist()
|
| 28 |
if len(filtered_local_names)>5:
|
| 29 |
filtered_local_names = filtered_local_names[:5]
|
|
@@ -32,8 +32,8 @@ def predict_bm25(service):
|
|
| 32 |
demo = gr.Interface(fn=predict_bm25,inputs=gr.components.Textbox(label='Запрос пользователя'),
|
| 33 |
outputs=[gr.components.Textbox(label='Рекомендованные услуги')],
|
| 34 |
examples=[
|
| 35 |
-
['ферритин'],
|
| 36 |
['кальций'],
|
|
|
|
| 37 |
['железо'],
|
| 38 |
['прием']])
|
| 39 |
|
|
|
|
| 23 |
|
| 24 |
sorted_local_names = np.array([b25local_names[i] for i in sorted_doc_indices])
|
| 25 |
scores = doc_scores[sorted_doc_indices]
|
| 26 |
+
scores_filtered = np.argwhere(scores>1).reshape(-1)
|
| 27 |
filtered_local_names = sorted_local_names[scores_filtered.tolist()].tolist()
|
| 28 |
if len(filtered_local_names)>5:
|
| 29 |
filtered_local_names = filtered_local_names[:5]
|
|
|
|
| 32 |
demo = gr.Interface(fn=predict_bm25,inputs=gr.components.Textbox(label='Запрос пользователя'),
|
| 33 |
outputs=[gr.components.Textbox(label='Рекомендованные услуги')],
|
| 34 |
examples=[
|
|
|
|
| 35 |
['кальций'],
|
| 36 |
+
['узи'],
|
| 37 |
['железо'],
|
| 38 |
['прием']])
|
| 39 |
|