hankcs/HanLP

中文分词 词性标注 命名实体识别 依存句法分析 成分句法分析 语义依存分析 语义角色标注 指代消解 风格转换 语义相似度 新词发现 关键词短语提取 自动摘要 文本分类聚类 拼音简繁转换 自然语言处理

What it solves

HanLP is a comprehensive toolkit designed to make cutting-edge natural language processing (NLP) technology accessible and practical for production environments. It addresses the need for a high-performance, accurate, and multi-language solution that can handle complex linguistic tasks across various scales, from lightweight mobile applications to massive data processing pipelines.

How it works

HanLP operates using two primary API modes: a lightweight RESTful API for quick, easy integration without heavy hardware requirements, and a native API built on PyTorch and TensorFlow 2.x for high-performance, local processing. It offers both multi-task models (which are faster and memory-efficient) and single-task models (which offer higher precision). Users can easily customize the system using trie-based dictionaries and rule-based systems to adapt to specific domains.

Who it’s for

It is designed for developers, NLP engineers, and researchers who need a robust, multi-lingual tool for tasks like word segmentation, part-of-speech tagging, named entity recognition, and syntactic analysis. It is suitable for anyone ranging from those building agile mobile apps to those managing large-scale, professional-grade NLP research projects.

Highlights

  • Supports 130 languages, including Chinese, English, Japanese, Russian, French, and German.
  • Provides a wide range of tasks including tokenization, dependency parsing, semantic role labeling, and text classification.
  • Offers consistent semantic interfaces across both RESTful and native API implementations.
  • Includes built-in visualization tools to display linguistic structures directly in the console.
  • Features a flexible pipeline mode for assembling custom sequences of single-task models.

Related

  • Project
  • Project
  • Project
  • Project
  • Project