| 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") |