Win7--MITIE

1.安装cmake

下载官网:https://cmake.org/download/
解压后把bin目录配置到path的环境变量中。
例如目录:D:\cmake\cmake-3.12.0-rc2-win64-x64\bin
执行文件为:

2018/06/29  09:49        18,561,536 cmake-gui.exe
2018/06/29  09:49         7,696,896 cmake.exe
2018/06/29  09:49           810,496 cmcldeps.exe
2018/06/29  09:49         7,408,640 cpack.exe
2018/06/29  09:49         8,171,520 ctest.exe

2.安装boost

下载官网:https://www.boost.org/

cd D:\boost\boost_1_67_0\tools\build
bootstrap.bat
.\b2 --prefix=D:\boost\bin install

把这个目录增加到系统的环境变量中

D:\boost\bin\bin

目录显示为:

D:\cmake\cmake-3.12.0-rc2-win64-x64\bin>dir D:\boost\bin\bin
 驱动器 D 中的卷是 软件
 卷的序列号是 35BB-BC3B

 D:\boost\bin\bin 的目录

2018/07/09  09:19    <DIR>          .
2018/07/09  09:19    <DIR>          ..
2018/07/09  09:19           387,072 b2.exe
2018/07/09  09:19           387,072 bjam.exe
               2 个文件        774,144 字节
               2 个目录 152,865,292,288 可用字节

3.安装MITIE

pip install git+https://github.com/mit-nlp/MITIE.git

这里写图片描述

另外,这个是mitie的发行版本
https://github.com/mit-nlp/MITIE/releases/

4.MITIE模型训练

我们把所有分好词的语料文件放在同一个文件路径下。接下来我们要训练MITIE模型。

首先将MITIE clone下来:

$ git clone https://github.com/mit-nlp/MITIE.git

我们要使用的只是MITIE其中wordrep这一个工具。我们先build它。

$ cd MITIE/tools/wordrep
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build . --config Release

然后训练模型,得到total_word_feature_extractor.dat。注意这一步训练会耗费几十GB的内存,大概需要两到三天的时间。。。

$ ./wordrep -e /path/to/your/folder_of_cutted_text_files

引用:https://mp.weixin.qq.com/s/pdHAMBhNOiANe2JUUMadYw

注:要安装VS,我测试的是vs2017.

猜你喜欢

转载自blog.csdn.net/ld326/article/details/80965689