# HanLP

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

Repository: https://github.com/hankcs/HanLP
Canonical: https://ross.abutalabs.com/products/hanlp
Homepage: https://www.hanlp.com/
Language: Python
License: Apache-2.0
License Family: permissive
Topics: nlp, natural-language-processing, hanlp, pos-tagging, dependency-parser, text-classification, named-entity-recognition, semantic-parsing
Last push: 2025-11-15T23:08:17+00:00
Link (homepage): https://www.hanlp.com/

## Health v2 (maintenance only)
Score: 57/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 52, release rhythm 40, longevity 100
- inputs: {"age_days": 4346, "days_push": 291, "days_rel": 598, "gap_med": 15, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 36484, forks 10915 (observed 2026-08-28T04:12:01.122928+00:00)

## What it is
HanLP is a production-oriented multilingual NLP toolkit built on PyTorch and TensorFlow 2.x, offering tokenization, POS tagging, NER, dependency and constituency parsing, semantic role labeling, summarization, and text classification across 130 languages. It ships dozens of pretrained models with a Python API and RESTful service options.

## Use cases
- segment chinese text into words
- extract named entities from chinese documents
- parse dependency trees for sentences
- summarize long articles automatically
- classify or cluster documents by topic
- extract keywords and key phrases from text
- convert between simplified and traditional chinese with pinyin
- compute semantic similarity between sentences

## When to choose
- you need state-of-the-art chinese or multilingual NLP in python
- you want pretrained models for many NLP tasks in one toolkit
- you need production-ready accuracy and active maintenance

## When to avoid
- you need a lightweight pure-python solution without deep learning dependencies
- you only need english-only NLP with a simpler ecosystem like spaCy
- you cannot download large pretrained models

## Facets
- artifact type: library
- maturity: active
- function: nlp, machine-learning, parser, search-engine
- domain: machine-learning, developer-tools
- platform: python, cross-platform
- tags: chinese-word-segmentation, named-entity-recognition, dependency-parsing, text-summarization, pytorch, multilingual, pretrained-models, text-classification, natural-language-processing

## Member repositories
- hankcs/HanLP (main) score 57
- hankcs/pyhanlp (sdk) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:12:01.122928+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:26:11.160206+00:00, confidence not recorded.
  - readme: https://github.com/hankcs/HanLP (fetched 2026-08-28T04:12:01.122928+00:00, sha d375c0e6818a)
  - homepage: https://www.hanlp.com/ (fetched 2026-08-29T07:47:36.326013+00:00, sha f3fd9c926b60)
  - registry_pypi: https://pypi.org/pypi/hanlp/json (fetched 2026-08-29T07:47:36.332823+00:00, sha f3aa45864174)
  - registry_pypi: https://pypi.org/pypi/pyhanlp/json (fetched 2026-08-29T07:47:36.334801+00:00, sha db3fe79a49b8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
