<PAD>の単語ベクトルを単語ベクトルに追加します

embtxt = "./test.txt"
with open(embtxt,"r+") as f:
	content = f.read()
        f.seek(0, 0)
        text = "'PAD'\t"
	for i in range(300):
		text += "0\t"
	text = text[0:-1]
        f.write(text + '\n' + content)

 

おすすめ

転載: blog.csdn.net/u011939633/article/details/93766173