提交 264981e4 作者: imClumsyPanda

update webui.py

上级 9f07ead5
...@@ -69,7 +69,7 @@ LLM_HISTORY_LEN = 3 ...@@ -69,7 +69,7 @@ LLM_HISTORY_LEN = 3
# return top-k text chunk from vector store # return top-k text chunk from vector store
VECTOR_SEARCH_TOP_K = 5 VECTOR_SEARCH_TOP_K = 5
# 如果为0,则不生效,经测试小于500值的结果更精准 # 知识检索内容相关度 Score, 数值范围0-1000,如果为0,则不生效,经测试设置为小于500时,匹配结果更精准
VECTOR_SEARCH_SCORE_THRESHOLD = 0 VECTOR_SEARCH_SCORE_THRESHOLD = 0
NLTK_DATA_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "nltk_data") NLTK_DATA_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "nltk_data")
......
...@@ -57,7 +57,7 @@ def get_answer(query, vs_path, history, mode, score_threshold=VECTOR_SEARCH_SCOR ...@@ -57,7 +57,7 @@ def get_answer(query, vs_path, history, mode, score_threshold=VECTOR_SEARCH_SCOR
else: else:
source = "".join( source = "".join(
[ [
f"""<details> <summary>[score值]:{doc.metadata["score"]} - ({i + 1})[出处]: {os.path.split(doc.metadata["source"])[-1]}</summary>\n""" f"""<details> <summary>【出处{i + 1}】: {os.path.split(doc.metadata["source"])[-1]} - 【内容匹配相关度 Score】:{doc.metadata["score"]}</summary>\n"""
f"""{doc.page_content}\n""" f"""{doc.page_content}\n"""
f"""</details>""" f"""</details>"""
for i, doc in for i, doc in
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论