基于CRFs的中文分词系统:Chinese Segmentor

jopen 10年前

Chinese Segmentor是什么?

Chinese Segmentor基于CRFs的中文分词系统,使用sgd训练,速度快,并且支持Online learning和Incremental learning,同时可以使用hadoop实现并行训练

Chinese Segmentor有哪些特性?

  • 训练速度快

  • 支持大规模数据的训练

  • N-best输出

  • 可视化展示切分(解码)过程

安装

安装依赖的DoubleArrayTrie

参考DoubleArrayTrie的文档

安装

  • 下载最新代码
  • mvn clean compile assembly:single

用法

查看帮助

java -cp target/chinesesegmentor-1.0-jar-with-dependencies.jar com.antbrains.crf.SgdCrf
Usage:   SgdCrf help   SgdCrf train    [encoding]   SgdCrf train2    [encoding]   SgdCrf hdfs-train     [encoding] [hdfsconf1] [hdfsconf2] ...   SgdCrf test    [encoding]   SgdCrf tag  [nBest] [encoding]

训练数据格式

目前支持两种格式的训练数据:CRF++格式的数据;tab分割的数据。

人民日报的数据已经被处理成合适的格式了,使用了6标签:B E S B1 B2 M,即单字词为S,两字词为B E,三字词为B B1 E,四字词为 B B1 B2 E,五字词为B B1 B2 M E,...

项目主页:http://www.open-open.com/lib/view/home/1397011641856