local_doc_qa.py

This commit is contained in:
yawudede 2023-05-22 10:36:41 +08:00 committed by GitHub
parent 037b5e4502
commit 9140a5e70c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -301,7 +301,9 @@ class LocalDocQA:
vector_store.score_threshold = self.score_threshold
related_docs_with_score = vector_store.similarity_search_with_score(query, k=self.top_k)
###########################################精排 之前faiss检索作为粗排 需要设置config参数
###########################################精排 之前faiss检索作为粗排 需要设置model_config参数VECTOR_SEARCH_TOP_K =300
###########################################原理粗排faiss+semantic search 检索得到大量相关文档需要设置ECTOR_SEARCH_TOP为300然后合并文档重新切分
#############################################利用knn+ semantic search 进行二次检索输入到prompt
####提取文档
related_docs = get_docs_with_score(related_docs_with_score)
text_batch0=[]