This commit is contained in:
hsafaei
2026-07-15 19:29:16 +03:30
parent cd3c93c7ae
commit 13253bf2df
2 changed files with 57 additions and 9 deletions
+12 -3
View File
@@ -424,11 +424,20 @@ body_no_rank={
# #---------- # #----------
# #----- conflict_relation_identifications total_vote, total_count, avge : 41412.600000000915 114953 0.3602568006054728 # #----- conflict_relation_identifications total_vote, total_count, avge : 41412.600000000915 114953 0.3602568006054728
# #-------------------------------------------------- # #--------------------------------------------------
# #-------------------------------------------------- # #--------------------------------------------------
C_avg_su = 0.9036775587731085 # #----- subject_unity total_vote, total_count, avge : 350754.3999994566 663381 0.528737482682586
# #----------
# #----- conflict_detections total_vote, total_count, avge : -891082.9999999751 994299 -0.8961921916847699
# #----------
# #----- conflict_relation_identifications total_vote, total_count, avge : 83677.40000002725 158600 0.5276002522069814
# #--------------------------------------------------
C_avg_su = 0.528737482682586
# C_avg_cd = -1.0745626235324917 # C_avg_cd = -1.0745626235324917
C_avg_cd = 0 C_avg_cd = 0
C_avg_rt = 0.3602568006054728 C_avg_rt = 0.5276002522069814
### -----103 بسته ----------- ### -----103 بسته -----------
# C_avg_su = 0.1315904139433552 # C_avg_su = 0.1315904139433552
@@ -439,7 +448,7 @@ C_avg_rt = 0.3602568006054728
# re_compute_conflict_ranks(elastic, "mj_qa_conflict", C_avg_su, C_avg_cd, C_avg_rt, 3, body_no_rank) # re_compute_conflict_ranks(elastic, "mj_qa_conflict", C_avg_su, C_avg_cd, C_avg_rt, 3, body_no_rank)
# re_compute_conflict_ranks(elastic, "mj_qa_conflict", C_avg_su, C_avg_cd, C_avg_rt, 3, body_v3) re_compute_conflict_ranks(elastic, "mj_qa_conflict", C_avg_su, C_avg_cd, C_avg_rt, 3, body_v3)
## ----------------------------------------------------------------------- ## -----------------------------------------------------------------------
## ----------------------------------------------------------------------- ## -----------------------------------------------------------------------
+45 -6
View File
@@ -315,7 +315,7 @@ async def async_import_data_from_json(file, index_name, file_jumps, host, passwo
def convert_append_data_ro_es(_source, item) : def convert_append_data_ro_es(_source, item, fields, ref_key, ref_key_advance) :
subject_unitys = ( subject_unitys = (
_source["subject_unitys"] _source["subject_unitys"]
@@ -720,7 +720,7 @@ def append_conflict_to_elastic(
res = {"_id": id, "_source": _source} res = {"_id": id, "_source": _source}
# print("id start...", _id) # print("id start...", _id)
data = convert_append_data_ro_es(_source, item) data = convert_append_data_ro_es(_source, item, fields, ref_key, ref_key_advance)
if import_state: if import_state:
data["id"] = _id data["id"] = _id
@@ -856,7 +856,7 @@ async def async_append_conflict_to_elastic(
res = {"_id": id, "_source": _source} res = {"_id": id, "_source": _source}
# print("id start...", _id) # print("id start...", _id)
data = convert_append_data_ro_es(_source, item) data = convert_append_data_ro_es(_source, item, fields, ref_key, ref_key_advance)
if import_state: if import_state:
data["id"] = _id data["id"] = _id
@@ -900,7 +900,7 @@ def clear_array_object_by(array, ref_key):
array = [c for c in array if c["ref_key"] != ref_key] array = [c for c in array if c["ref_key"] != ref_key]
# تغییر کلید و حذف اضافات قبلی # تغییر کلید و حذف اضافات قبلی
# array = [c for c in array if (c["ref_key"] != "oss120-p2-v2" and c["ref_key"] != "gemma4-p2-v2" )] # array = [c for c in array if (c["ref_key"] != "gemma4-2" )]
return array return array
@@ -1089,7 +1089,7 @@ if __name__ == "__main__":
# elastic.backupIndexToZipfile("G:/Project2/111/server160", "mj_qa_context", "mj_qa_context") # elastic.backupIndexToZipfile("G:/Project2/111/server160", "mj_qa_context", "mj_qa_context")
# elastic.backupIndexToZipfile("G:/Project2/111/server160", "mj_qa_rule", "mj_qa_rule") # elastic.backupIndexToZipfile("G:/Project2/111/server160", "mj_qa_rule", "mj_qa_rule")
# elastic.backupIndexToZipfile("G:/Project2/111/server160", "mj_qa_conflict", "mj_qa_conflict") # elastic.backupIndexToZipfile("G:/Project2/102_gpu/v3_conflict", "mj_qa_conflict", "mj_qa_conflict")
# elastic.createIndex( 'mj_qa_conflict', 'majles', 'mj_qa_conflict', path_base_map+ 'majles/'+'mj_qa_conflict.json' ) # elastic.createIndex( 'mj_qa_conflict', 'majles', 'mj_qa_conflict', path_base_map+ 'majles/'+'mj_qa_conflict.json' )
# elastic.restorFileToElastic2('G:/Project2/111/server160/mj_qa_conflict.zip', 'mj_qa_conflict', 'majles', False) # elastic.restorFileToElastic2('G:/Project2/111/server160/mj_qa_conflict.zip', 'mj_qa_conflict', 'majles', False)
@@ -1255,6 +1255,45 @@ if __name__ == "__main__":
# ) # )
## ----------------------------------------------------
# #--- تعداد 285هزار گروه با 331هزار جفتی که قبلا با گما4 وحدت موضوع داشتند
# #--- با دو مدل دیگر کانفلیکت و وحدت موضوع بررسی شد
## ----------------------------------------------------
# asyncio.run(
# async_append_conflict_to_elastic( host, password,
# input_path=r"G:\Project2\102_gpu\v3_conflict\285k_conflict_gemma4\finall_data",
# out_put_index_name="mj_qa_conflict",
# ref_key="gemma4",
# fields=["conflict_detection", "conflict_relation_type"])
# )
# asyncio.run(
# async_append_conflict_to_elastic( host, password,
# input_path=r"G:\Project2\102_gpu\v3_conflict\285k_conflict_oss120\finall_data",
# out_put_index_name="mj_qa_conflict",
# ref_key="oss120",
# fields=["conflict_detection", "conflict_relation_type"])
# )
# asyncio.run(
# async_append_conflict_to_elastic( host, password,
# input_path=r"G:\Project2\102_gpu\v3_conflict\285k_subject_yourmind\finall_data",
# out_put_index_name="mj_qa_conflict",
# ref_key="yourmind",
# fields=["subject_unity"])
# )
# asyncio.run(
# async_append_conflict_to_elastic( host, password,
# input_path=r"G:\Project2\102_gpu\v3_conflict\285k_subject_oss120\finall_data",
# out_put_index_name="mj_qa_conflict",
# ref_key="oss120",
# fields=["subject_unity"])
# )
# elastic = ElasticHelper(es_url=host,es_pass= password,es_user= "elastic", path_mappings=path_base_map) # elastic = ElasticHelper(es_url=host,es_pass= password,es_user= "elastic", path_mappings=path_base_map)
# file_ouput = r"G:\Project2\102_gpu\v3_conflict\v3_103_pair.xlsx" # file_ouput = r"G:\Project2\102_gpu\v3_conflict\v3_103_pair.xlsx"
# genrate_excel_data(elastic, file_ouput, "mj_qa_conflict", "subject_unitys", "gemma4_103", "http://192.168.23.160" ) # genrate_excel_data(elastic, file_ouput, "mj_qa_conflict", "subject_unitys", "gemma4_103", "http://192.168.23.160" )
@@ -1262,4 +1301,4 @@ if __name__ == "__main__":
## ----------------------------------------------------------------------- ## -----------------------------------------------------------------------
# .\.env\Scripts\activate # .\.env\Scripts\activate
# python -m app.majles.majles_conflict_works_v2 # python -m app.majles.majles_conflict_works_v3