nahj speechs complete

This commit is contained in:
init_mahdi 2025-08-21 19:04:16 +03:30
parent 46ca9a6b50
commit 2cc613a8fe
3 changed files with 17844 additions and 0 deletions

File diff suppressed because it is too large Load Diff

7812
output/nahj_speechs_new.json Normal file

File diff suppressed because it is too large Load Diff

24
temp2.py Normal file
View File

@ -0,0 +1,24 @@
import json
path = './output/nahj_speechs_new.json'
with open(path, 'r' , encoding='utf-8') as f:
records = json.load(f)
for index, item in enumerate(records):
try:
if item['sentences']:
continue
except:
sentences = []
sentences.append(item['persian_translate'].strip())
item['sentences'] = sentences
path = './output/nahj_speechs_complete.json'
data = json.dumps(records, ensure_ascii=False, indent=2)
with open(path, 'w' , encoding='utf-8') as f:
f.write(data)
print('finished!')