huntzhan
V2EX  ›  分享创造

做了一个基于规则的中文数据预处理工具,发上来试试水

By huntzhan at 2018 年 10 月 31 日 · 4060 次点击

Usage、Install、 Repo

目前支持的功能

  • 中文分句。
  • 模式(如中文、英文、数字等 Unicode codepoint intervals )的提取与替换。
8 条回复  •  2018-11-01 12:13:56 +08:00
mingyun
   1
mingyun  
   2018 年 10 月 31 日
win 安装失败了
Failed building wheel for pyahocorasick
Running setup.py clean for pyahocorasick
Failed to build pyahocorasick
Installing collected packages: pyahocorasick, cnt.rulebase
Running setup.py install for pyahocorasick ... error
Complete output from command d:\python3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-build-wot4whvz\\pyahocorasick\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ADMINI~1\AppData\Local\Temp\pip-_6l5x87u-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'ahocorasick' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
huntzhan
   2
huntzhan  
OP
   2018 年 10 月 31 日
@mingyun
这个是依赖项 `pyahocorasick` 报错。

> error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

装 `Microsoft Visual C++ 14.0` 应该可以解决问题。我的实现应该是可以在 Windows 跑的。
NCZkevin
   3
NCZkevin  
   2018 年 11 月 1 日   ❤️ 1
中文工具竟然没有中文文档。。感觉分词效果很一般
NCZkevin
   4
NCZkevin  
   2018 年 11 月 1 日
看了下源码,感觉现在功能还不完善,经常用这方面的库,先 star 关注后续更新
huntzhan
   5
huntzhan  
OP
   2018 年 11 月 1 日
@NCZkevin 没做分词(在做了,目前还没开源),你是指分句效果不行对吧?
如果有见过更好的支持中文分句的库,希望可以推荐一下。核心的问题是,中文分句没有标注数据,我也只能上规则做这个事情了。
dezhou
   6
dezhou  
   2018 年 11 月 1 日 via Android
分句的意思是根据句号分?
huntzhan
   7
huntzhan  
OP
   2018 年 11 月 1 日
爱意满满的作品展示区。
© 2026 V2EX · 30ms · 3.9.8.5