gn_dataset

This commit is contained in:
hsafaei
2025-02-15 17:11:23 +03:30
parent d0e89d4cd8
commit a34b808d18
4 changed files with 102 additions and 8 deletions
+46
View File
@@ -0,0 +1,46 @@
import os
from text_normalizer import TextNormalizer
# from general import *
from general_functions import *
from elastic_helper import ElasticHelper
def moveDataset1(elastic, file, index_name_o):
try:
try:
list = elastic.iterateJsonFile(file)
except Exception as e:
save_error(0, e)
count = 0
text_normal = TextNormalizer()
for mentry in list:
count += 1
#print(mentry)
entry = mentry["source"]
id = entry.get("id", "")
domain = entry.get("domain", "")
if domain == 'تغییرات قانون':
continue
#"value":"استخراج کلیدواژه 11 هزارتایی"
print(id)
#print(entry["content"])
# data = {}
# # data["chunk_keywords"]= chunk_keywords
# update = False
# eid = id
# try:
# resp = elastic.update_index_doc(update, index_name_o, eid, data)
# except Exception as e:
# save_error(id, e)
except Exception as e:
save_error(id, e)