Merge branch 'master' of https://git2.tavasi.ir/develop/dataParsers
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
|
||||
@@ -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']),
|
||||
"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
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
source config.env
|
||||
#virtualenv .venv
|
||||
source .venv/bin/activate
|
||||
|
||||
#pip install -r requirements.txt
|
||||
#uvicorn app.main:app --host=0.0.0.0 --port=8010 --reload
|
||||
Reference in New Issue
Block a user