From 2cd3351dbdce2998131afc930b13384015868b65 Mon Sep 17 00:00:00 2001 From: weiweiw <14335254+weiweiw22@user.noreply.gitee.com> Date: Sun, 9 Mar 2025 14:49:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E8=AF=95=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=B0=86=E5=A4=9A=E8=BD=AE=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/main.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/api/main.py b/api/main.py index 817e31f..3948d07 100644 --- a/api/main.py +++ b/api/main.py @@ -208,22 +208,22 @@ def agent(): print(f"多轮意图识别后的label:{predicted_label}, id:{predicted_id},槽位抽取后的实体:{entities},message:{messages}") - #必须槽位缺失检查 - status, sk = check_lost(predicted_id, entities) - if status == CheckResult.NEEDS_MORE_ROUNDS: - return jsonify({"code": 10001, "msg": "成功", - "answer": { "miss": sk}, - }) - - #工程名和项目名标准化 - print(f"start to check_project_standard_slot") - result, information = check_project_standard_slot(predicted_id, entities) - print(f"end check_project_standard_slot,{result},{information}") - if result == CheckResult.NEEDS_MORE_ROUNDS: - return jsonify({ - "code": 10001, "msg": "成功", - "answer": {"miss": information}, - }) + # #必须槽位缺失检查 + # status, sk = check_lost(predicted_id, entities) + # if status == CheckResult.NEEDS_MORE_ROUNDS: + # return jsonify({"code": 10001, "msg": "成功", + # "answer": { "miss": sk}, + # }) + # + # #工程名和项目名标准化 + # print(f"start to check_project_standard_slot") + # result, information = check_project_standard_slot(predicted_id, entities) + # print(f"end check_project_standard_slot,{result},{information}") + # if result == CheckResult.NEEDS_MORE_ROUNDS: + # return jsonify({ + # "code": 10001, "msg": "成功", + # "answer": {"miss": information}, + # }) return jsonify({ "code": 200,"msg": "成功", From 285865e9a83dd56f3e44326bf480d072361b993a Mon Sep 17 00:00:00 2001 From: weiweiw <14335254+weiweiw22@user.noreply.gitee.com> Date: Sun, 9 Mar 2025 14:51:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/main.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/api/main.py b/api/main.py index 3948d07..ecde1ea 100644 --- a/api/main.py +++ b/api/main.py @@ -23,16 +23,18 @@ labels = [ # 标签映射 label_map = { - 0: 'O', 1: 'B-date', 11: 'I-date', - 2: 'B-projectName', 12: 'I-projectName', - 3: 'B-projectType', 13: 'I-projectType', - 4: 'B-constructionUnit', 14: 'I-constructionUnit', - 5: 'B-implementationOrganization', 15: 'I-implementationOrganization', - 6: 'B-projectDepartment', 16: 'I-projectDepartment', - 7: 'B-projectManager', 17: 'I-projectManager', - 8: 'B-subcontractor', 18: 'I-subcontractor', - 9: 'B-teamLeader', 19: 'I-teamLeader', - 10: 'B-riskLevel', 20: 'I-riskLevel' + 0: 'O', # 非实体 + 1: 'B-date', 12: 'I-date', + 2: 'B-project_name', 13: 'I-project_name', + 3: 'B-project_type', 14: 'I-project_type', + 4: 'B-construction_unit', 15: 'I-construction_unit', + 5: 'B-implementation_organization', 16: 'I-implementation_organization', + 6: 'B-project_department', 17: 'I-project_department', + 7: 'B-project_manager', 18: 'I-project_manager', + 8: 'B-subcontractor', 19: 'I-subcontractor', + 9: 'B-team_leader', 20: 'I-team_leader', + 10: 'B-risk_level', 21: 'I-risk_level', + 11: 'B-page', 22: 'I-page', } # 初始化工具类