首先,建立自己的语料库
def ylk(x):
seg = jieba.cut(x, cut_all=False)
with open('D://listTwo.txt', 'a',encoding='utf-8')as f:
for word in seg:
f.write(word+ )
f.write('\n')
训练模型
from gensim.models.word2vec import LineSentence, Word2Vec
#加载语料库
sentences = LineSentence(D://
2023-03-28 10:06:53
33KB
c
ec
OR
1