|
@@ -37,14 +37,14 @@ template_dict = {
|
|
|
"9.17": ["某年省间交易电量挂牌交易电量是多少?"],
|
|
|
"16.1": ["当月送出均价最高的是哪个省?","当年送出均价最高的是哪个省?"],
|
|
|
"16.2": ["当月送出均价最低的是哪个省?","当年送出均价最低的是哪个省?"],
|
|
|
- "17.1": ["那个省送出电量最高?是多少?"],
|
|
|
- "17.2": ["那个省受入电量最高?是多少?"],
|
|
|
- "17.3": ["那个省送出电量最低?是多少?"],
|
|
|
- "17.4": ["那个省受入电量最低?是多少?"],
|
|
|
- "18.1": ["那个省送出均价最高?是多少?"],
|
|
|
- "18.2": ["那个省受入均价最高?是多少?"],
|
|
|
- "18.3": ["那个省送出均价最低?是多少?"],
|
|
|
- "18.4": ["那个省受入均价最低?是多少?"],
|
|
|
+ "17.1": ["某年某月哪个省送出电量最高?是多少?"],
|
|
|
+ "17.2": ["某年某月哪个省受入电量最高?是多少?"],
|
|
|
+ "17.3": ["某年某月哪个省送出电量最低?是多少?"],
|
|
|
+ "17.4": ["某年某月哪个省受入电量最低?是多少?"],
|
|
|
+ "18.1": ["某年某月哪个省送出均价最高?是多少?"],
|
|
|
+ "18.2": ["某年某月哪个省受入均价最高?是多少?"],
|
|
|
+ "18.3": ["某年某月哪个省送出均价最低?是多少?"],
|
|
|
+ "18.4": ["某年某月哪个省受入均价最低?是多少?"],
|
|
|
"19": ["省间交易正在组织的交易有多少?"],
|
|
|
"20": ["省间交易当月完成的交易有多少?"],
|
|
|
"21": ["省间交易当年完成的交易有多少?"],
|
|
@@ -316,11 +316,11 @@ def classify_by_time_type(query, time_info):
|
|
|
|
|
|
# 情况 2:有 year 和 month,精确到月
|
|
|
if 'year' in time and 'month' in time:
|
|
|
- return ['2','16.1','16.2','20'] # 某年某月交易电量
|
|
|
+ return ['2','8.1','16.1','16.2','17.1', '17.2', '17.3', '17.4', '18.1', '18.2', '18.3', '18.4','19','20','21','22','23',] # 某年某月交易电量
|
|
|
|
|
|
# 情况 3:仅 year,全年
|
|
|
if 'year' in time and 'month' not in time:
|
|
|
- return ['1','8.1','8.2','8.3','8.4','9.1','9.2','9.3','9.4','9.5','9.6','9.7','9.8','9.9','9.10','9.11','9.12','9.13','9.14','9.15','9.16','9.17','16.1','16.2','21','22','23','24','25','26','27'] # 某年全年累计交易电量
|
|
|
+ return ['1','8.1','8.2','8.3','8.4','9.1','9.2','9.3','9.4','9.5','9.6','9.7','9.8','9.9','9.10','9.11','9.12','9.13','9.14','9.15','9.16','9.17','16.1','16.2','17.1', '17.2', '17.3', '17.4', '18.1', '18.2', '18.3', '18.4','19','20','21','22','23','24','25','26','27'] # 某年全年累计交易电量
|
|
|
def match_template_with_time_filter(query, template_dict, tokenizer, extract_time_location_func):
|
|
|
"""
|
|
|
先基于时间信息筛选候选模板,再进行TF-IDF匹配。
|
|
@@ -559,27 +559,27 @@ def find_key_recursively(data, target_key):
|
|
|
# query = "2023年省间交易电量新能源交易电量是多少??"
|
|
|
# query = "今年1月到2023年2月累计交易电量是多少?"
|
|
|
# query = "2024年送出电量第二名是谁?"
|
|
|
-query = "2024年7月、8月、12月交易电量的平均值是多少?"
|
|
|
-
|
|
|
-json_folder = "templatesJson"
|
|
|
-
|
|
|
+# query = "2024年7月、8月、12月交易电量的平均值是多少?"
|
|
|
#
|
|
|
+# json_folder = "templatesJson"
|
|
|
#
|
|
|
-result = process_query(query, template_dict, json_folder)
|
|
|
-#
|
|
|
-print(result)
|
|
|
-print(result['content'])
|
|
|
-print("匹配的模板 key:", result["matched_key"])
|
|
|
-print("最相似的模板句:", result["matched_template"])
|
|
|
-print("相似度分数:", result["similarity_score"])
|
|
|
-print("类型:", result["type"])
|
|
|
-print("关键词:", result["keywords"])
|
|
|
-print("查询字段:", result["target"])
|
|
|
-print("模型名字", result["name"])
|
|
|
-print("条件", result["conditions"])
|
|
|
-print("返回的内容是:", result["content"])
|
|
|
-print("问句是:", result["query"])
|
|
|
-print("动作是:", result["play"])
|
|
|
+# #
|
|
|
+# #
|
|
|
+# result = process_query(query, template_dict, json_folder)
|
|
|
+# #
|
|
|
+# print(result)
|
|
|
+# print(result['content'])
|
|
|
+# print("匹配的模板 key:", result["matched_key"])
|
|
|
+# print("最相似的模板句:", result["matched_template"])
|
|
|
+# print("相似度分数:", result["similarity_score"])
|
|
|
+# print("类型:", result["type"])
|
|
|
+# print("关键词:", result["keywords"])
|
|
|
+# print("查询字段:", result["target"])
|
|
|
+# print("模型名字", result["name"])
|
|
|
+# print("条件", result["conditions"])
|
|
|
+# print("返回的内容是:", result["content"])
|
|
|
+# print("问句是:", result["query"])
|
|
|
+# print("动作是:", result["play"])
|
|
|
|
|
|
# query = "当月送出均价最高的是哪个省??"
|
|
|
# query = ("2025年送出电量前五名是谁??")
|