RepositoryPythonCNChina
dongrixinyu

dongrixinyu/jiojio

A convenient Chinese word segmentation tool 简便中文分词器

50stars
8forks
1issues
3views

jiojio

- 基于CPU的高性能、持续迭代模型、简便中文分词器

a convenient Chinese word segmentation tool

适用场景

  • 基于 CPU 的高性能、持续优化 中文分词器。

功能

  • 基于 C 的 Python 接口分词器,CPU 单进程运行性能达 13.4 万字/秒,多个分词工具性能对比

  • 网页版 JioNLP源站,可快速试用分词、词性标注功能

  • 基于 CRF 算法,精细优化的 字符特征工程,模型特征说明

  • 对模型文件的尽力压缩,使用 np.float8 精度类型,500万特征参数,模型文件大小30M,方便 pip 安装

  • 添加自定义词典兼容静态、动态两种方式,流程一致性强,词典配置说明

  • 将规则加入模型,有效克服某些类型文本受限于模型处理的情况,分词-添加正则

  • 支持词性标注功能,与 JioNLP 联合实现关键短语抽取、新闻地域识别 等功能

安装

  • pip 方式(稳定版本)
$ pip install jiojio
  • Git 方式(开发版本)
$ git clone https://github.com/dongrixinyu/jiojio
$ cd jiojio
$ pip install .
  • 非 ubuntu 环境的 C 安装 如使用 windows 或 mac 等操作系统或其它硬件,则没有直接可调用 C 的库,程序默认直接调用纯 Python 进行分词,因此速度会慢。可以使用以下方式安装编译 C 库。以下方式仅供参考,在熟悉 C 语言后进行调试使用。关于windows平台的编译说明
$ git clone https://github.com/dongrixinyu/jiojio
$ cd jiojio/jiojio/jiojio_cpp
$ ./compiler.sh

使用

  • 基础方式
>>> import jiojio
>>> jiojio.init()
>>> print(jiojio.cut('开源软件应秉持全人类共享的精神,搞封闭式是行不通的。'))

# ['开源', '软件', '应', '秉持', '全人类', '共享', '的', '精神', ',', '搞', '封闭式', '是', '行', '不通', '的', '。']
# 可通过 jiojio.help() 获取基本使用方式说明
# 可通过 print(jiojio.init.__doc__) 获取模型初始化的各类参数

关于 jiojio 分词器的一些问答

  • 可能早十年把这个分词器写出来,jiojio 也许现在就会流行起来。在 ChatGPT 称霸 NLP 界的今天,我写这个工具,加速这个工具,纯粹是为了提升一下 C 语言的编程能力。ChatGPT 能够做出来,还是需要理想主义的,我写这个工具同理。
  • 与jiojio有关的问答

TODO

  • 对分词器效果做标注数据更新,模型长期优化

交流群聊

  • 欢迎加入自然语言处理NLP交流群,搜索wx公众号“JioNLP”,或扫以下码即可入群

image

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

188.2k
Nov 29, 2026
RepositoryPython
huggingface/transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

169.5k
Dec 1, 2026
RepositoryPython
harry0703/MoneyPrinterTurbo

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

147.3k
Dec 1, 2026
RepositoryPython
d2l-ai/d2l-zh

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

82.9k
Jul 30, 2024
RepositoryPython
howl-anderson/MicroTokenizer

一个轻量且功能全面的中文分词器,帮助学生了解分词器的工作原理。MicroTokenizer: A lightweight Chinese tokenizer designed for educational and research purposes. Provides a practical, hands-on approach to understanding NLP concepts, featuring multiple tokenization algorithms and customizable models. Ideal for students, researchers, and NLP enthusiasts..

161
Oct 18, 2024
RepositoryPython
donnemartin/system-design-primer

Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.

379.9k
Sep 15, 2026
RepositoryPython
vinta/awesome-python

The definitive list that answers "I want to do X in Python, which tool should I use?"

338.6k
Nov 28, 2026
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryPython
TheAlgorithms/Python

All Algorithms implemented in Python

226.6k
Nov 13, 2026