Spaces:
Runtime error
Runtime error
makcrx
commited on
Commit
•
3334b06
1
Parent(s):
1831c9b
fix
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def main(query):
|
|
14 |
result_docs = db.similarity_search_with_score(query, k=20)
|
15 |
|
16 |
if len(query_keywords) > 0:
|
17 |
-
result_docs = filter(lambda doc: len(set(extract_keywords(doc[0].page_content)).intersection(query_keywords)) > 0, result_docs)
|
18 |
|
19 |
if len(result_docs) == 0:
|
20 |
return 'Ответ не найден', 0, ''
|
|
|
14 |
result_docs = db.similarity_search_with_score(query, k=20)
|
15 |
|
16 |
if len(query_keywords) > 0:
|
17 |
+
result_docs = list(filter(lambda doc: len(set(extract_keywords(doc[0].page_content)).intersection(query_keywords)) > 0, result_docs))
|
18 |
|
19 |
if len(result_docs) == 0:
|
20 |
return 'Ответ не найден', 0, ''
|