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']) :
|
||||
body = {
|
||||
'ai_code': {},
|
||||
'ai_codes': []
|
||||
}
|
||||
if ai_code :
|
||||
body['ai_code'] = {}
|
||||
if ai_codes :
|
||||
body['ai_codes'] = []
|
||||
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["score"] >= 1 :
|
||||
ai_code["score"] = ai_code["score"] / 100
|
||||
@@ -145,6 +133,19 @@ def repair_ai_codes( elastic, index_name_i, index_name_o, file_log) :
|
||||
"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 :
|
||||
body['ai_code'] = ai_code
|
||||
if ai_codes :
|
||||
|
||||
Reference in New Issue
Block a user