ai_codes
This commit is contained in:
@@ -113,24 +113,12 @@ def repair_ai_codes( elastic, index_name_i, index_name_o, file_log) :
|
|||||||
#----------------------------------------------
|
#----------------------------------------------
|
||||||
|
|
||||||
if other_info and is_section_empty(other_info['full_path']) :
|
if other_info and is_section_empty(other_info['full_path']) :
|
||||||
body = {
|
if ai_code :
|
||||||
'ai_code': {},
|
body['ai_code'] = {}
|
||||||
'ai_codes': []
|
if ai_codes :
|
||||||
}
|
body['ai_codes'] = []
|
||||||
else:
|
else:
|
||||||
#----------------------------------------------
|
#----------------------------------------------
|
||||||
for label_doc in ai_codes:
|
|
||||||
label = text_normal.normalize_qanon(label_doc["label"])
|
|
||||||
label_doc["label"] = label
|
|
||||||
if label_doc["score"] >= 1 :
|
|
||||||
label_doc["score"] = label_doc["score"] / 100
|
|
||||||
history_codes.append({
|
|
||||||
"version_key": "D51_v1",
|
|
||||||
"sub_key": "sub",
|
|
||||||
"label": text_normal.normalize_qanon(label_doc['label']),
|
|
||||||
"score": label_doc['score'],
|
|
||||||
})
|
|
||||||
|
|
||||||
if ai_code :
|
if ai_code :
|
||||||
if ai_code["score"] >= 1 :
|
if ai_code["score"] >= 1 :
|
||||||
ai_code["score"] = ai_code["score"] / 100
|
ai_code["score"] = ai_code["score"] / 100
|
||||||
@@ -144,6 +132,19 @@ def repair_ai_codes( elastic, index_name_i, index_name_o, file_log) :
|
|||||||
"label": text_normal.normalize_qanon(ai_code['label']),
|
"label": text_normal.normalize_qanon(ai_code['label']),
|
||||||
"score": ai_code['score'],
|
"score": ai_code['score'],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
for label_doc in ai_codes:
|
||||||
|
label = text_normal.normalize_qanon(label_doc["label"])
|
||||||
|
label_doc["label"] = label
|
||||||
|
if label_doc["score"] >= 1 :
|
||||||
|
label_doc["score"] = label_doc["score"] / 100
|
||||||
|
history_codes.append({
|
||||||
|
"version_key": "D51_v1",
|
||||||
|
"sub_key": "sub",
|
||||||
|
"label": text_normal.normalize_qanon(label_doc['label']),
|
||||||
|
"score": label_doc['score'],
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
if ai_code :
|
if ai_code :
|
||||||
body['ai_code'] = ai_code
|
body['ai_code'] = ai_code
|
||||||
|
|||||||
Reference in New Issue
Block a user