1
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user