diff --git a/app/majles/majles_conflict_ranks_v3.py b/app/majles/majles_conflict_ranks_v3.py index 948dc73..daf98d0 100644 --- a/app/majles/majles_conflict_ranks_v3.py +++ b/app/majles/majles_conflict_ranks_v3.py @@ -424,11 +424,20 @@ body_no_rank={ # #---------- # #----- 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 = 0 -C_avg_rt = 0.3602568006054728 +C_avg_rt = 0.5276002522069814 ### -----103 بسته ----------- # 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_v3) +re_compute_conflict_ranks(elastic, "mj_qa_conflict", C_avg_su, C_avg_cd, C_avg_rt, 3, body_v3) ## ----------------------------------------------------------------------- ## ----------------------------------------------------------------------- diff --git a/app/majles/majles_conflict_works_v3.py b/app/majles/majles_conflict_works_v3.py index 2378a7b..022f02a 100644 --- a/app/majles/majles_conflict_works_v3.py +++ b/app/majles/majles_conflict_works_v3.py @@ -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 = ( _source["subject_unitys"] @@ -720,7 +720,7 @@ def append_conflict_to_elastic( res = {"_id": id, "_source": _source} # 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: data["id"] = _id @@ -856,7 +856,7 @@ async def async_append_conflict_to_elastic( res = {"_id": id, "_source": _source} # 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: 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"] != "oss120-p2-v2" and c["ref_key"] != "gemma4-p2-v2" )] + # array = [c for c in array if (c["ref_key"] != "gemma4-2" )] 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_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.restorFileToElastic2('G:/Project2/111/server160/mj_qa_conflict.zip', 'mj_qa_conflict', 'majles', False) @@ -1254,6 +1254,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) # file_ouput = r"G:\Project2\102_gpu\v3_conflict\v3_103_pair.xlsx" @@ -1262,4 +1301,4 @@ if __name__ == "__main__": ## ----------------------------------------------------------------------- # .\.env\Scripts\activate -# python -m app.majles.majles_conflict_works_v2 +# python -m app.majles.majles_conflict_works_v3