数据处理代码,为了生成chatgpt数据
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
483 B

2 years ago
import json
data = []
with open("data/title_mulu_to_/small_title_prompt_2.txt", encoding="utf-8") as f:
texts = f.read()
texts_list = texts.split("\n")
for i in texts_list:
data_dan = i.strip("\"").strip("\n").strip("\"").strip("\"")
data.append(data_dan)
data_new = data[10000:40000]
with open("./data/title_mulu_to_/small_title_prompt_2_10000_40000.txt", mode="w", encoding="utf-8") as f:
for i in data_new:
f.write(i)
f.write("\n")