← all repositories
baidu/lac

A 2MB Chinese NLP stack that runs on a budget phone

LAC gives Chinese NLP a single, fast, tweakable model that handles segmentation, tagging, and entity recognition in one pass instead of a pipeline.

4k stars C++ Language Models
lac
Not currently ranked — collecting fresh signals.
star history

What it does LAC is a joint lexical analysis toolkit for Chinese. It takes raw text and performs word segmentation, part-of-speech tagging, named entity recognition, and word-importance scoring in one pass. The underlying model is a deep Bi-GRU-CRF network trained by Baidu’s NLP team, exposed through Python, Java, C++, and Android interfaces.

The interesting bit Rather than treating segmentation, tagging, and NER as separate pipeline stages, LAC trains them together as multi-task objectives. That shared representation is what lets it claim an overall F1 above 0.91 while still pushing 800 QPS on a single CPU thread—or 200 QPS on a budget phone using a 2 MB model.

Key highlights

  • Jointly segments text, tags named entities (PER, LOC, ORG, TIME), and scores word importance on a 0–3 scale in a single inference pass.
  • Ships with a user-dictionary mechanism that overrides model output with custom long-phrase matches for precise domain adaptation.
  • Supports incremental training on your own UTF-8 data, provided you stick to the built-in tag schema.
  • The mobile variant is a 2 MB model that reportedly hits 200 QPS on low-end Android hardware.
  • Bindings for Python, Java, C++, and Android ship in the same repository.

Caveats

  • Incremental training for the full lexical-analysis mode requires your data to use the exact tag schema shipped with LAC; custom schemas are not yet supported.
  • The dictionary customization feature does not yet support wildcard entries, though the README says that is planned.
  • The codebase still advertises Python 2 compatibility, which may signal aging maintenance.

Verdict If you need Chinese word segmentation, POS tagging, or named entity recognition in a single model with minimal assembly, LAC is worth a look. If you work primarily outside Chinese or need a fully custom tag schema today, look elsewhere.

Frequently asked

What is baidu/lac?
LAC gives Chinese NLP a single, fast, tweakable model that handles segmentation, tagging, and entity recognition in one pass instead of a pipeline.
Is lac open source?
Yes — baidu/lac is open source, released under the Apache-2.0 license.
What language is lac written in?
baidu/lac is primarily written in C++.
How popular is lac?
baidu/lac has 4k stars on GitHub.
Where can I find lac?
baidu/lac is on GitHub at https://github.com/baidu/lac.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.