Browse Source

合并冲突

dujunlong 2 months ago
parent
commit
8422607295
44 changed files with 95 additions and 56 deletions
  1. BIN
      final/ByRules/__pycache__/similarity_answer_json.cpython-39.pyc
  2. BIN
      final/ByRules/__pycache__/util.cpython-39.pyc
  3. 2 0
      final/ByRules/app.py
  4. 2 7
      final/ByRules/similarity_answer_json.py
  5. 2 1
      final/ByRules/templatesJson/1.json
  6. 3 2
      final/ByRules/templatesJson/16.1.json
  7. 3 2
      final/ByRules/templatesJson/16.2.json
  8. 3 2
      final/ByRules/templatesJson/17.1.json
  9. 3 2
      final/ByRules/templatesJson/17.2.json
  10. 3 2
      final/ByRules/templatesJson/17.3.json
  11. 3 2
      final/ByRules/templatesJson/17.4.json
  12. 3 2
      final/ByRules/templatesJson/18.1.json
  13. 3 2
      final/ByRules/templatesJson/18.2.json
  14. 3 2
      final/ByRules/templatesJson/18.3.json
  15. 3 2
      final/ByRules/templatesJson/18.4.json
  16. 2 1
      final/ByRules/templatesJson/19.json
  17. 2 1
      final/ByRules/templatesJson/2.json
  18. 2 1
      final/ByRules/templatesJson/20.json
  19. 2 1
      final/ByRules/templatesJson/21.json
  20. 2 1
      final/ByRules/templatesJson/22.json
  21. 2 1
      final/ByRules/templatesJson/23.json
  22. 2 1
      final/ByRules/templatesJson/3.json
  23. 2 1
      final/ByRules/templatesJson/8.1.json
  24. 2 1
      final/ByRules/templatesJson/8.2.json
  25. 2 1
      final/ByRules/templatesJson/8.3.json
  26. 2 1
      final/ByRules/templatesJson/8.4.json
  27. 2 1
      final/ByRules/templatesJson/9.1.json
  28. 2 1
      final/ByRules/templatesJson/9.10.json
  29. 2 1
      final/ByRules/templatesJson/9.11.json
  30. 2 1
      final/ByRules/templatesJson/9.12.json
  31. 2 1
      final/ByRules/templatesJson/9.13.json
  32. 2 1
      final/ByRules/templatesJson/9.14.json
  33. 2 1
      final/ByRules/templatesJson/9.15.json
  34. 2 1
      final/ByRules/templatesJson/9.16.json
  35. 2 1
      final/ByRules/templatesJson/9.17.json
  36. 2 1
      final/ByRules/templatesJson/9.2.json
  37. 2 1
      final/ByRules/templatesJson/9.3.json
  38. 2 1
      final/ByRules/templatesJson/9.4.json
  39. 2 1
      final/ByRules/templatesJson/9.5.json
  40. 2 1
      final/ByRules/templatesJson/9.6.json
  41. 2 1
      final/ByRules/templatesJson/9.7.json
  42. 2 1
      final/ByRules/templatesJson/9.8.json
  43. 2 1
      final/ByRules/templatesJson/9.9.json
  44. 3 0
      final/Json/json_data/sjjy1_B06_output.json

BIN
final/ByRules/__pycache__/similarity_answer_json.cpython-39.pyc


BIN
final/ByRules/__pycache__/util.cpython-39.pyc


+ 2 - 0
final/ByRules/app.py

@@ -30,11 +30,13 @@ app = Flask(__name__)
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
 TEMPLATE_FOLDER = os.path.join(BASE_DIR, "templatesJson")
 DATA_FOLDER = os.path.join(BASE_DIR, "..", "Json", "json_data")
+
 MAPPING_FOLDER = os.path.join(BASE_DIR, "..", "Json", "sjgxys")
 
 MAPPING_FILE = os.path.join(MAPPING_FOLDER, "sjgxys.json")
 
 
+
 @app.route('/process_query', methods=['POST'])
 def process_query_route():
     data = request.get_json()

+ 2 - 7
final/ByRules/similarity_answer_json.py

@@ -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"])

+ 2 - 1
final/ByRules/templatesJson/1.json

@@ -5,5 +5,6 @@
   "target": "省间交易电量",
   "content": "全年累计交易电量是&",
   "play": "讲述文本",
-  "name": "年省间交易电量"
+  "name": "年省间交易电量",
+  "unit": "亿千瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/16.1.json

@@ -6,6 +6,7 @@
   "find_max": "True",
   "content": "送出均价最高的省份是&,送出均价是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "16.1"
+  "name": "地图",
+  "qcode": "16.1",
+  "unit": "元/兆瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/16.2.json

@@ -6,6 +6,7 @@
   "find_max": "False",
   "content": "送出均价最低的省份是&,送出均价是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "16.2"
+  "name": "地图",
+  "qcode": "16.2",
+  "unit": "元/兆瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/17.1.json

@@ -6,6 +6,7 @@
   "find_max": "True",
   "content": "送出电量最高的省份是&,送出电量是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "17.1"
+  "name": "地图",
+  "qcode": "17.1",
+  "unit": "亿千瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/17.2.json

@@ -6,6 +6,7 @@
   "find_max": "True",
   "content": "受入电量最高的省份是&,受入电量是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "17.2"
+  "name": "地图",
+  "qcode": "17.2",
+  "unit": "亿千瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/17.3.json

@@ -6,6 +6,7 @@
   "find_max": "False",
   "content": "送出电量最低的省份是&,送出电量是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "17.3"
+  "name": "地图",
+  "qcode": "17.3",
+  "unit": "亿千瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/17.4.json

@@ -6,6 +6,7 @@
   "find_max": "False",
   "content": "受入电量最低的省份是&,受入电量是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "17.4"
+  "name": "地图",
+  "qcode": "17.4",
+  "unit": "亿千瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/18.1.json

@@ -6,6 +6,7 @@
   "find_max": "True",
   "content": "送出均价最高的省份是&,送出均价是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "18.1"
+  "name": "地图",
+  "qcode": "18.1",
+  "unit": "元/兆瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/18.2.json

@@ -6,6 +6,7 @@
   "find_max": "True",
   "content": "受入均价最高的省份是&,受入均价是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "18.2"
+  "name": "地图",
+  "qcode": "18.2",
+  "unit": "元/兆瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/18.3.json

@@ -6,6 +6,7 @@
   "find_max": "False",
   "content": "送出均价最低的省份是&,送出均价是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "18.3"
+  "name": "地图",
+  "qcode": "18.3",
+  "unit": "元/兆瓦时"
 }

+ 3 - 2
final/ByRules/templatesJson/18.4.json

@@ -6,6 +6,7 @@
   "find_max": "False",
   "content": "受入均价最低的省份是&,受入均价是&",
   "play": "讲述文本",
-  "name": "省间交易",
-  "qcode": "18.4"
+  "name": "地图",
+  "qcode": "18.4",
+  "unit": "元/兆瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/19.json

@@ -5,5 +5,6 @@
   "target": "正在组织",
   "content": "省间交易正在组织的交易为&",
   "play": "讲述文本",
-  "name": "省间交易组织"
+  "name": "省间交易组织",
+  "unit": "笔"
 }

+ 2 - 1
final/ByRules/templatesJson/2.json

@@ -5,5 +5,6 @@
   "target": "交易电量",
   "content": "月交易电量是&",
   "play": "讲述文本",
-  "name": "月省间交易电量"
+  "name": "月省间交易电量",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/20.json

@@ -5,5 +5,6 @@
   "target": "当月完成",
   "content": "省间交易当月完成的交易为&",
   "play": "讲述文本",
-  "name": "省间交易组织"
+  "name": "省间交易组织",
+  "unit": "笔"
 }

+ 2 - 1
final/ByRules/templatesJson/21.json

@@ -5,5 +5,6 @@
   "target": "当年完成",
   "content": "省间交易当年完成的交易为&",
   "play": "讲述文本",
-  "name": "省间交易组织"
+  "name": "省间交易组织",
+  "unit": "笔"
 }

+ 2 - 1
final/ByRules/templatesJson/22.json

@@ -5,5 +5,6 @@
   "target": "当年达成电量",
   "content": "省间交易当年达成的电量为&",
   "play": "讲述文本",
-  "name": "省间交易组织"
+  "name": "省间交易组织",
+  "unit": "笔"
 }

+ 2 - 1
final/ByRules/templatesJson/23.json

@@ -5,5 +5,6 @@
   "target": "参与交易家次",
   "content": "省间交易当年参与交易的家次为&",
   "play": "讲述文本",
-  "name": "省间交易组织"
+  "name": "省间交易组织",
+  "unit": "家"
 }

+ 2 - 1
final/ByRules/templatesJson/3.json

@@ -5,5 +5,6 @@
   "target": "交易电量",
   "content": "累计交易电量是&",
   "play": "讲述文本",
-  "name": "月省间交易电量"
+  "name": "月省间交易电量",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/8.1.json

@@ -5,5 +5,6 @@
   "target": "按交易周期划分",
   "content": "省间交易电量按交易周期划分的电量是&",
   "play": "讲述文本",
-  "name": "按 交易周期 划分"
+  "name": "按 交易周期 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/8.2.json

@@ -5,5 +5,6 @@
   "target": "按交易类型划分",
   "content": "省间交易电量按交易类型划分的电量是&",
   "play": "讲述文本",
-  "name": "按 交易类型 划分"
+  "name": "按 交易类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/8.3.json

@@ -5,5 +5,6 @@
   "target": "按发电类型划分",
   "content": "省间交易电量按发电类型划分的电量是&",
   "play": "讲述文本",
-  "name": "按 发电类型 划分"
+  "name": "按 发电类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/8.4.json

@@ -5,5 +5,6 @@
   "target": "按交易方式划分",
   "content": "省间交易电量按交易方式划分的电量是&",
   "play": "讲述文本",
-  "name": "按 交易方式 划分"
+  "name": "按 交易方式 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.1.json

@@ -5,5 +5,6 @@
   "target": "年度交易",
   "content": "省间交易电量年度交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易周期 划分"
+  "name": "按 交易周期 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.10.json

@@ -5,5 +5,6 @@
   "target": "非市场化",
   "content": "省间交易电量非市场化交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易类型 划分"
+  "name": "按 交易类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.11.json

@@ -5,5 +5,6 @@
   "target": "新能源",
   "content": "省间交易电量新能源交易电量是&",
   "play": "讲述文本",
-  "name": "按 发电类型 划分"
+  "name": "按 发电类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.12.json

@@ -5,5 +5,6 @@
   "target": "火电",
   "content": "省间交易电量火电交易电量是&",
   "play": "讲述文本",
-  "name": "按 发电类型 划分"
+  "name": "按 发电类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.13.json

@@ -5,5 +5,6 @@
   "target": "水电",
   "content": "省间交易电量水电交易电量是&",
   "play": "讲述文本",
-  "name": "按 发电类型 划分"
+  "name": "按 发电类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.14.json

@@ -5,5 +5,6 @@
   "target": "核电",
   "content": "省间交易电量核电交易电量是&",
   "play": "讲述文本",
-  "name": "按 发电类型 划分"
+  "name": "按 发电类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.15.json

@@ -5,5 +5,6 @@
   "target": "双边",
   "content": "省间交易电量双边交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易方式 划分"
+  "name": "按 交易方式 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.16.json

@@ -5,5 +5,6 @@
   "target": "集中",
   "content": "省间交易电量集中交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易方式 划分"
+  "name": "按 交易方式 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.17.json

@@ -5,5 +5,6 @@
   "target": "挂牌",
   "content": "省间交易电量挂牌交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易方式 划分"
+  "name": "按 交易方式 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.2.json

@@ -5,5 +5,6 @@
   "target": "月度交易",
   "content": "省间交易电量月度交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易周期 划分"
+  "name": "按 交易周期 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.3.json

@@ -5,5 +5,6 @@
   "target": "现货交易",
   "content": "省间交易电量现货交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易周期 划分"
+  "name": "按 交易周期 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.4.json

@@ -5,5 +5,6 @@
   "target": "应急交易",
   "content": "省间交易电量应急交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易周期 划分"
+  "name": "按 交易周期 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.5.json

@@ -5,5 +5,6 @@
   "target": "月内交易",
   "content": "省间交易电量月内交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易周期 划分"
+  "name": "按 交易周期 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.6.json

@@ -5,5 +5,6 @@
   "target": "省间外送",
   "content": "省间交易电量省间外送交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易类型 划分"
+  "name": "按 交易类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.7.json

@@ -5,5 +5,6 @@
   "target": "电力直接交易",
   "content": "省间交易电量电力直接交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易类型 划分"
+  "name": "按 交易类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.8.json

@@ -5,5 +5,6 @@
   "target": "合同交易",
   "content": "省间交易电量合同交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易类型 划分"
+  "name": "按 交易类型 划分",
+  "unit": "亿千瓦时"
 }

+ 2 - 1
final/ByRules/templatesJson/9.9.json

@@ -5,5 +5,6 @@
   "target": "绿电交易",
   "content": "省间交易电量绿电交易电量是&",
   "play": "讲述文本",
-  "name": "按 交易类型 划分"
+  "name": "按 交易类型 划分",
+  "unit": "亿千瓦时"
 }

+ 3 - 0
final/Json/json_data/sjjy1_B06_output.json

@@ -1,6 +1,9 @@
 {
   "年": 2025,
+
   "月": 6,
+
+
   "正在组织": "601.0",
   "当月完成": "316.0",
   "当年完成": "1499.0",