|
@@ -388,7 +388,7 @@ def process_query(query, template_dict, json_folder, tokenizer=jieba_tokenizer):
|
|
|
extract_time_location_func=extract_time_location
|
|
|
)
|
|
|
# 定义阈值
|
|
|
- similarity_threshold = 0.3
|
|
|
+ similarity_threshold = 0.25
|
|
|
# ★ 判断相似度阈值
|
|
|
if score < similarity_threshold:
|
|
|
return {
|
|
@@ -527,19 +527,14 @@ def find_key_recursively(data, target_key):
|
|
|
|
|
|
|
|
|
# query = "2023年省间交易电量新能源交易电量是多少??"
|
|
|
-# query = "2024年省间交易电量按交易周期划分的电量是多少?"
|
|
|
+# query = "今年1月到2023年2月累计交易电量是多少?"
|
|
|
#
|
|
|
# json_folder = "templatesJson"
|
|
|
#
|
|
|
-#
|
|
|
-# json_folder = "templatesJson"
|
|
|
# #
|
|
|
# #
|
|
|
# result = process_query(query, template_dict, json_folder)
|
|
|
#
|
|
|
-#
|
|
|
-#
|
|
|
-# result = process_query(query, template_dict, json_folder)
|
|
|
# # print(result)
|
|
|
# print(result['content'])
|
|
|
# print("匹配的模板 key:", result["matched_key"])
|