def update_1(self): path = "excel/3000_拒识语料.csv" data = pd.read_csv(path, sep=" ") sentence1 = data["sentence"].tolist() label1 = data["label"].tolist() t2 = pd.read_excel("excel/语义优化_0608_1.xlsx", sheet_name="data") sentence2 = t2["sentence"].tolist() label2 = t2["label"].tolist() t3 = pd.read_excel("excel/语义优化_0608_2.xlsx", sheet_name="data") sentence3 = t3["sentence"].tolist() label3 = t3["label"].tolist() s = sentence1 + sentence2 + sentence3 l = label1 + label2 + label3 with open("all.txt", "a+", encoding="utf8") as f: for _l,_s in zip(l, s): _l = _l.replace(" ", "").replace(" ", "").replace(" ", "").replace(" ", "") _s = _s.replace(" ", "").replace(" ", "").replace(" ", "").replace(" ", "") line = _l + " " + _s f.write(line + " ")