File size: 535 Bytes
b127d35
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import json
from mergelines import merge_short_lines

merged_data = merge_short_lines("./customchatbot-v1/data/data.jsonl")
with open("./customchatbot-v1/data/merged_data.jsonl","w",encoding="utf-8") as out:
    for item in merged_data:
        out.write(json.dumps(item) + "\n")

# with open("./customchatbot-v1/data/data.jsonl","r",encoding="utf-8") as out:
 #   for item in out:
 #       with open("./customchatbot-v1/data/backup_data.jsonl","w",encoding="utf-8") as out2:
 #           out2.write(json.dumps(item) + "\n")