tsroten / pynlpir

A Python wrapper around the NLPIR/ICTCLAS Chinese segmentation software.
MIT License
565 stars 135 forks source link

======= PyNLPIR

.. image:: https://badge.fury.io/py/pynlpir.svg :target: https://pypi.org/project/pynlpir

.. image:: https://github.com/tsroten/pynlpir/actions/workflows/ci.yml/badge.svg :target: https://github.com/tsroten/pynlpir/actions/workflows/ci.yml

PyNLPIR is a Python wrapper around the NLPIR/ICTCLAS Chinese segmentation software <http://www.nlpir.org/wordpress/>_.

About

Easily segment text using NLPIR, one of the most widely-regarded Chinese text analyzers:

.. code:: python

import pynlpir
pynlpir.open()

s = '欢迎科研人员、技术工程师、企事业单位与个人参与NLPIR平台的建设工作。'
pynlpir.segment(s)

[('欢迎', 'verb'), ('科研', 'noun'), ('人员', 'noun'), ('、', 'punctuation mark'), ('技术', 'noun'), ('工程师', 'noun'), ('、', 'punctuation mark'), ('企事业', 'noun'), ('单位', 'noun'), ('与', 'conjunction'), ('个人', 'noun'), ('参与', 'verb'), ('NLPIR', 'noun'), ('平台', 'noun'), ('的', 'particle'), ('建设', 'verb'), ('工作', 'verb'), ('。', 'punctuation mark')]

Features

Getting Started