Add the word vector of <PAD> to the word vector

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)

 

Guess you like

Origin blog.csdn.net/u011939633/article/details/93766173