plan majles
This commit is contained in:
+37
-32
@@ -92,6 +92,37 @@ def update_mj_qa_rules_with_rule_relations():
|
||||
}
|
||||
|
||||
|
||||
def get_evaluation_data(data: E):
|
||||
result = []
|
||||
if data.is_subject_unity_assessment_correct:
|
||||
result.append("تایید وجود وحدت موضوعی")
|
||||
else:
|
||||
result.append("رد وجود وحدت موضوعی")
|
||||
if data.is_conflict_detection_correct:
|
||||
result.append("تایید تشخیص مخالفت")
|
||||
else:
|
||||
result.append("رد تشخیص مخالفت")
|
||||
|
||||
if data.is_conflict_type_detection_correct:
|
||||
result.append("تایید تشخیص نوع مخالفت")
|
||||
else:
|
||||
result.append("رد تشخیص نوع مخالفت")
|
||||
|
||||
if data.is_relation_type_detection_correct:
|
||||
result.append("تایید تشخیص نوع تعارض")
|
||||
else:
|
||||
result.append("رد تشخیص نوع تعارض")
|
||||
return result
|
||||
|
||||
def get_vlid_text(text):
|
||||
if text == "valid":
|
||||
return "معتبر"
|
||||
elif text == "invalid":
|
||||
return "نامعتبر"
|
||||
elif text == "undetermined":
|
||||
return "نامشخص"
|
||||
|
||||
|
||||
def update_mj_qa_rules_with_4plan_data(
|
||||
index_schema_path=r"D:\init_mahdi\dataParsers\schema\mj_qa_rule.json",
|
||||
version_key="pair_gvc_e1_jv3_all",
|
||||
@@ -110,35 +141,7 @@ def update_mj_qa_rules_with_4plan_data(
|
||||
get_index_name="mj_qa_rule",
|
||||
out_put_index_name="mj_qa_conflict",
|
||||
):
|
||||
def get_evaluation_data(data: E):
|
||||
result = []
|
||||
if data.is_subject_unity_assessment_correct:
|
||||
result.append("تایید وجود وحدت موضوعی")
|
||||
else:
|
||||
result.append("رد وجود وحدت موضوعی")
|
||||
if data.is_conflict_detection_correct:
|
||||
result.append("تایید تشخیص مخالفت")
|
||||
else:
|
||||
result.append("رد تشخیص مخالفت")
|
||||
|
||||
if data.is_conflict_type_detection_correct:
|
||||
result.append("تایید تشخیص نوع مخالفت")
|
||||
else:
|
||||
result.append("رد تشخیص نوع مخالفت")
|
||||
|
||||
if data.is_relation_type_detection_correct:
|
||||
result.append("تایید تشخیص نوع تعارض")
|
||||
else:
|
||||
result.append("رد تشخیص نوع تعارض")
|
||||
return result
|
||||
|
||||
def get_vlide_text(text):
|
||||
if text == "valid":
|
||||
return "معتبر"
|
||||
elif text == "invalid":
|
||||
return "نامعتبر"
|
||||
elif text == "undetermined":
|
||||
return "نامشخص"
|
||||
|
||||
map_sec_id_full_path = {}
|
||||
for i in DataHelper.load_orjson(r"D:\init_mahdi\dataParsers\mj_qa_section.json"):
|
||||
try:
|
||||
@@ -253,8 +256,8 @@ def update_mj_qa_rules_with_4plan_data(
|
||||
"description": item.evaluation.comments,
|
||||
},
|
||||
"conflict_final": {
|
||||
"valid_state1": get_vlide_text(item.final_validity.section1_validity),
|
||||
"valid_state2": get_vlide_text(item.final_validity.section2_validity),
|
||||
"valid_state1": get_vlid_text(item.final_validity.section1_validity),
|
||||
"valid_state2": get_vlid_text(item.final_validity.section2_validity),
|
||||
"description": item.final_validity.evaluator_comments,
|
||||
},
|
||||
}
|
||||
@@ -272,13 +275,15 @@ def update_mj_qa_rules_with_4plan_data(
|
||||
print("=" * 10, "to_elastic , total=" + str(total_count))
|
||||
elastic.importBulkList(bulk_data, out_put_index_name)
|
||||
bulk_data = []
|
||||
|
||||
|
||||
print(f"failed_data {len(failed_data)}")
|
||||
DataHelper.save_orjson(
|
||||
data=failed_data,
|
||||
path=r"D:\init_mahdi\dataParsers\failed_data_mj_qa_conflict.json",
|
||||
)
|
||||
|
||||
|
||||
update_mj_qa_rules_with_4plan_data()
|
||||
|
||||
|
||||
# python -m dataParsers.app.update_mj_qa_rules
|
||||
|
||||
Reference in New Issue
Block a user