Giter Site home page Giter Site logo

lac's Introduction

百度 LAC

修改百度 LAC 分词的Java版本。 百度LAC 是很不错的分词工具。但是其java版本比较丑陋。 这里做了修改。 此外, baidu lac 受限于训练语料, 一些数字识别不正确,我们同时做了效果上的修改。

接口修改

  • 增加构造函数,从已有的LAC 对象复制一个对象。
  • 增加close 函数,删除 jni 的 lac 对象
  • 增加runLables 函数, 直接返回 crf 的标签
  • 另外增加了一个Segmenter 对象,处理一些准业务
    • 使用线程局部存储复制 LAC
    • 返回对象修改为其他NLP 系统的格式
    • 修正数字识别
      • 长数字的硬性修改
      • 一些数字应该是数量词
    • 修正时间识别
      • 时间识别的粒度变小一点
      • 相同格式的不同时间识别结果保持一致(这个比较困难)

使用方法

  • clone 本项目
  • 将native 目录下的压缩文件解开(就放到该目录下,不要有子目录)
  • 另外安装baidu lac 的python版本 用data 目录下的文件增量训练
    • 也可以不训练(也就不安装 百度lac), 直接使用本项目训练的模型
  • 直接运行 项目中的两个类 的 main 方法
  • 本项目编译的 native 代码 没有使用GPU, 如果要自己编译, 参照C++ 目录

部署

  • 打包jar
  • 将 native 目录下的文件(解开后的)复制到目标机器的任意目录 java -Dlac_library_path=XXX 其中XXX 是存放上述native 文件的 目录。

lac's People

Contributors

zhouzusheng avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.