V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
huntzhan
V2EX  ›  分享创造

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

  •  1
     
  •   huntzhan ·
    huntzhan · 2018-10-31 19:44:49 +08:00 · 2998 次点击
    这是一个创建于 1975 天前的主题,其中的信息可能已经有所发展或是发生改变。

    UsageInstallRepo

    目前支持的功能

    • 中文分句。
    • 模式(如中文、英文、数字等 Unicode codepoint intervals )的提取与替换。
    8 条回复    2018-11-01 12:13:56 +08:00
    mingyun
        1
    mingyun  
       2018-10-31 22:19:04 +08:00
    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 22:22:25 +08:00
    @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-01 00:18:12 +08:00   ❤️ 1
    中文工具竟然没有中文文档。。感觉分词效果很一般
    NCZkevin
        4
    NCZkevin  
       2018-11-01 00:33:11 +08:00
    看了下源码,感觉现在功能还不完善,经常用这方面的库,先 star 关注后续更新
    huntzhan
        5
    huntzhan  
    OP
       2018-11-01 04:44:50 +08:00
    @NCZkevin 没做分词(在做了,目前还没开源),你是指分句效果不行对吧?
    如果有见过更好的支持中文分句的库,希望可以推荐一下。核心的问题是,中文分句没有标注数据,我也只能上规则做这个事情了。
    dezhou
        6
    dezhou  
       2018-11-01 12:07:02 +08:00 via Android
    分句的意思是根据句号分?
    huntzhan
        7
    huntzhan  
    OP
       2018-11-01 12:11:22 +08:00
    huntzhan
        8
    huntzhan  
    OP
       2018-11-01 12:13:56 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5459 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:43 · PVG 14:43 · LAX 23:43 · JFK 02:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.