list_tags qanon_usefull

This commit is contained in:
hsafaei
2025-01-19 18:56:06 +03:30
parent c1ef81c632
commit 0479c89387
7 changed files with 718 additions and 82 deletions
+33 -15
View File
@@ -16,16 +16,34 @@ password=os.getenv('HOST_160_PASS')
print(host)
# print(password)
elastic = ElasticHelper(host, password)
path_base_map = "G:/Project2/gateway2/repo/_other/"
elastic = ElasticHelper(host, password, "elastic", path_base_map)
# -----------------------------------------------------------------
### انتقال اطلاعات قبلی به اینجا
##-----------------------------------------------------------------
##----- انتقال اطلاعات قبلی به اینجا
#elastic.moveCustomFileds("mj_qa_section", "mj_qa_section_temp", ["ners_v1", "nlp_parser", "code-ai"])
elastic.renameElasticIndex("mj_qa_opinion_temp", "mj_qa_opinion", "majles", "mj_qa_opinion")
elastic.renameElasticIndex("mj_qa_qanon_temp", "mj_qa_qanon", "majles", "mj_qa_qanon")
elastic.renameElasticIndex("mj_qa_section_temp", "mj_qa_section", "majles", "mj_qa_section")
elastic.renameElasticIndex("mj_rg_section_temp", "mj_rg_section", "majles", "mj_qa_section")
## -----------------------------------------------------------------
## ----- تغییر ایندکسهای موقت به ایندکسهای اصلی
# elastic.deleteIndex("mj_qa_opinion")
# elastic.renameElasticIndex("mj_qa_opinion_temp", "mj_qa_opinion", "majles", "mj_qa_opinion")
# elastic.deleteIndex("mj_qa_qanon")
# elastic.renameElasticIndex("mj_qa_qanon_temp", "mj_qa_qanon", "majles", "mj_qa_qanon")
# elastic.deleteIndex("mj_qa_section")
# elastic.renameElasticIndex("mj_qa_section_temp", "mj_qa_section", "majles", "mj_qa_section")
# elastic.deleteIndex("mj_rg_section")
# elastic.renameElasticIndex("mj_rg_section_temp", "mj_rg_section", "majles", "mj_qa_section")
## -----------------------------------------------------------------
## فیلدهایی تصحیح می شود و فیلدهای پر می شود
## بعضی موارد اگر در ابتدا صحیح انجام شود اینجا نیاز نیست دیگه مثل :
## title_type
fill_list_tags(elastic, "mj_qa_section")
fill_list_tags(elastic, "mj_rg_section")
## -----------------------------------------------------------------
ai_url_base=os.getenv("AI_URL_BASE")
@@ -46,14 +64,14 @@ ai_url_class='http://192.168.23.51:6111/class'
# print(response)
payload={
"text":"طرفین به منظور اتمام مطالعات و احداث نیروگاه‌های جریانی ارس و تأسیسات مربوطه، منطقه مشترک ساختمانی و مطالعاتی را تعیین و امنیت این منطقه را در طول مدت اجراء و بهره‌برداری تأمین می‌نمایند. "
}
response = requests.request("POST", ai_url_class, headers=HEADERS, json=payload)
print(response.text)
print(response)
# payload={
# "text":"طرفین به منظور اتمام مطالعات و احداث نیروگاه‌های جریانی ارس و تأسیسات مربوطه، منطقه مشترک ساختمانی و مطالعاتی را تعیین و امنیت این منطقه را در طول مدت اجراء و بهره‌برداری تأمین می‌نمایند. "
# }
# response = requests.request("POST", ai_url_class, headers=HEADERS, json=payload)
# print(response.text)
# print(response)
resp = json.loads(response.text)
print(resp['result'])
# resp = json.loads(response.text)
# print(resp['result'])