美文网首页
fasttext实现word2vec时获取训练数据enwik9及

fasttext实现word2vec时获取训练数据enwik9及

作者: 丙吉 | 来源:发表于2022-12-26 22:24 被阅读0次

1. 用fasttext实现word2vec时,第一步需要获取训练数据,自己下载耗时太长,大约耗时半小时左右,下载地址:http://mattmahoney.net/dc/enwik9.zip

2. 下载到data文件夹下后解压文件

 unzip enwik9.zip 

解压后的文件是xml格式,如下图所示:

head -10 enwik9
image.png

3. 将xml格式的数据处理成所需数据

perl wikifil.pl enwik9 > fil9
其中wikifil.pl文件可从网上复制即可。http://mattmahoney.net/dc/textdata.html
image.png
查看处理后的数据,都是词汇,如下图:
head -c 80 fil9
image.png

相关文章

网友评论

      本文标题:fasttext实现word2vec时获取训练数据enwik9及

      本文链接:https://www.haomeiwen.com/subject/qsfoqdtx.html