ttb1534 / word2vec-include-datapreprocess

word2vec-include-datapreprocess

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

word2vec-include-datapreprocess

数据集链接:https://pan.baidu.com/s/1RHhHp8Y5_Y0AjYQ5Oa0CTA 提取码:1534

拿到数据集后处理思路如下:

image-20220306222246864

原始新闻数据集为news.txt,先进行数据预处理得到分词后的文件:

python dataprocess.py

得到cutdata.txt,再利用word2vec模型进行词嵌入:

python train.py

得到word_embedding.txt文件,最后可测试效果:

python test.py

在上文提供的数据集链接中的datasave文件夹已经包含经处理过后的cutdata_prepare.txt和word_embedding_pretrained.txt,可直接用来测试

word2vec的处理思路如下:

image-20220306222748653

其主要**和原理见:https://zhuanlan.zhihu.com/p/476920885

About

word2vec-include-datapreprocess


Languages

Language:Python 100.0%