上传文件至 kg_lab_6.13
6.17 更新对检索工程数据复杂表达式的能力
This commit is contained in:
+17
-5
@@ -3,10 +3,20 @@ from vector_lab import intersection_of_three_lists
|
||||
from utils import find_target_item, find_target_items, pre_mapping, pre_mapping2
|
||||
import json
|
||||
|
||||
# 样例
|
||||
# input_str1 = "杆塔总基数是多少?"
|
||||
# input_str2 = "单回路长度是多少?"
|
||||
# input_str3 = "计算一下角钢塔的塔材装材费"
|
||||
# input_str4 = "计算一下土石方总量"
|
||||
# input_str5 = "板式塔基的各类基础数量占总塔基数比例是多少?"
|
||||
# input_str6 = "基础混凝土总量是多少"
|
||||
# input_str7 = "计算一下本体工程机械费"
|
||||
# input_str8 = "项目建设技术服务费合计"
|
||||
|
||||
# 初始化
|
||||
problem_rewrite = Problem_rewrite()
|
||||
|
||||
from utils import extract_concrete_info, extract_query_prefix_list
|
||||
from utils import extract_concrete_info, extract_query_prefix_list, split_chinese_bracketed_phrases
|
||||
|
||||
from chains_lab import question_answer, question_answer_calculation
|
||||
|
||||
@@ -76,14 +86,16 @@ while True:
|
||||
|
||||
elif isinstance(question, list):
|
||||
ques = extract_query_prefix_list(question)
|
||||
ques_info = extract_concrete_info(question)
|
||||
temp = extract_concrete_info(question)
|
||||
ques_info = split_chinese_bracketed_phrases(temp[0])
|
||||
print(ques)
|
||||
|
||||
retriever_info = []
|
||||
for i in ques:
|
||||
response = booway_cypher_chain.invoke(ques)
|
||||
# generated_cypher = response.get("intermediate_steps")[0]
|
||||
for idx, i in enumerate(ques):
|
||||
response = booway_cypher_chain.invoke(i)
|
||||
temp = response.get("result")
|
||||
retriever_info.append(temp)
|
||||
|
||||
|
||||
retriever_keywords = ques_info[0]
|
||||
calculation = ques_info[-1]
|
||||
|
||||
Reference in New Issue
Block a user