dujunlong 2 months ago
parent
commit
a543d89442

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


+ 1 - 0
final/ByRules/answer.py

@@ -267,6 +267,7 @@ def process_question(question: str):
 # 示例调用
 if __name__ == "__main__":
     # question = "2023年累计省间交易电量是多少?"
+    # question = "2023年年度累计省间交易电量?"   1111
     # question = "2024年12月交易电量是多少?"
     # question = "去年12月交易电量是多少?"
     # question = "前年12月交易电量是多少?"

+ 2 - 2
final/ByRules/app.py

@@ -40,8 +40,8 @@ def process_query_route():
         #  查询类问题:
         if result['type'] == 'query':
             final_value = smart_find_value(DATA_FOLDER, result["dataJsonName"], result["conditions"], result["target"])
-            # final_content = result["content"].replace("&", str(final_value))
-            final_content = fill_template_auto(result['content'], final_value)
+            final_content = result["content"].replace("&", str(final_value))
+            # final_content = fill_template_auto(result['content'], final_value)
             response = {
                 "content": final_content,
                 "content_text": result["content"],

+ 7 - 7
final/ByRules/similarity_answer_json.py

@@ -473,21 +473,21 @@ def find_key_recursively(data, target_key):
 
 
 # query = "2023年省间交易电量新能源交易电量是多少??"
-# # query = "但同样阿贾克斯大口径的话我可合金外壳设计文件突然发?"
-
+# query = "2024年省间交易电量按交易周期划分的电量是多少?"
+#
 # json_folder = "templatesJson"
-
+#
 #
 # json_folder = "templatesJson"
 # #
 # #
 # result = process_query(query, template_dict, json_folder)
 #
-
-
-# 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"])
 # print("最相似的模板句:", result["matched_template"])
 # print("相似度分数:", result["similarity_score"])