ner tagging

This commit is contained in:
hsafaei
2025-02-15 13:19:35 +03:30
parent b54683638a
commit dabf86ba7d
5 changed files with 118 additions and 1378 deletions
+13 -8
View File
@@ -60,10 +60,10 @@ elastic = ElasticHelper(host, password, "elastic", path_base_map)
# تولید بردار برای اجزائی که لازم هست
#elastic.createIndex("mj_qa_section_ai", 'majles/', "mj_qa_section" )
# elastic.createIndex("mj_qa_section_ai", 'majles/', "mj_qa_section" )
ai_url_vec=os.getenv("ai_url_vec")
import_data_embeding(elastic, ai_url_vec ,"mj_qa_section", "mj_qa_section_ai", "content" )
# ai_url_vec=os.getenv("ai_url_vec")
# import_data_embeding(elastic, ai_url_vec ,"mj_qa_section", "mj_qa_section_ai", "content" )
## 4.2 ## -----------------------------------------------------------------
@@ -76,17 +76,22 @@ import_data_embeding(elastic, ai_url_vec ,"mj_qa_section", "mj_qa_section_ai", "
##///////////////////////////////////////////////////////////
## پشتیبان گیری
# path_back = os.getcwd() + '/data_back'
path_back = 'G:/Project2/111'
# if not os.path.exists(path_back) :
# os.makedirs(path_back)
# print('---> path_back = ' + path_back)
# elastic.backupIndexToZipfile(path_back, "mj_qa_qanon")
#elastic.backupIndexToZipfile(path_back, "mj_qa_qanon")
# elastic.backupIndexToZipfile(path_back, "mj_qa_section")
# elastic.backupIndexToZipfile(path_back, "mj_rg_section")
# elastic.backupIndexToZipfile(path_back, "mj_qa_opinion")
elastic.backupIndexToZipfile(path_back, "mj_qa_section", '', {}, True, [], ["pos_tags", "chunk_tags", "version_info"])
#elastic.backupIndexToZipfile(path_back, "mj_qa_section_ai")
#elastic.backupIndexToZipfile(path_back, "mj_rg_section")
#elastic.backupIndexToZipfile(path_back, "mj_qa_opinion")
## کد نمونه بازیابی از فایل
# path_back = 'G:/Project2/_back/back_data/data_majles/elastic/v1.0/full'
# elastic.restorFileToElastic(path_back, 'mj_qa_section', 'majles')
#path_back = 'G:/Project2/_back/back_data/data_majles/elastic/v1.0/full'
# path_back = 'G:/Project2/111'
# elastic.restorFileToElastic(path_back, 'mj_qa_section_ai', 'majles', True, 'mj_qa_section')