pyltp: the python extension for LTP
Project description
pyltp
pyltp 是 语言技术平台(Language Technology Platform, LTP)的 Python 封装。
在使用 pyltp 之前,您需要简要了解 语言技术平台(LTP) 能否帮助您解决问题。
一个简单的例子
下面是一个使用 pyltp 进行分词的例子
# -*- coding: utf-8 -*-
from pyltp import Segmentor
segmentor = Segmentor()
segmentor.load("/path/to/your/cws/model")
words = segmentor.segment("元芳你怎么看")
print "|".join(words)
segmentor.release()
除了分词之外,pyltp 还提供词性标注、命名实体识别、依存句法分析、语义角色标注等功能。
详细使用方法请参考 在线文档。
安装
-
第一步,安装 pyltp
使用 pip 安装
$ pip install pyltp
或从源代码安装
$ git clone https://github.com/HIT-SCIR/pyltp $ git submodule init $ git submodule update $ python setup.py install # Mac系统出现版本问题使用 MACOSX_DEPLOYMENT_TARGET=10.7 python setup.py install
-
第二步,下载模型文件
七牛云,当前模型版本 3.4.0
版本对应
- pyltp 版本:0.2.0
- LTP 版本:3.4.0
- 模型版本:3.4.0
作者
- 徐梓翔 << zxxu@ir.hit.edu.cn >> 2015-01-20 解决跨平台运行问题
- 刘一佳 << yjliu@ir.hit.edu.cn >> 2014-06-12 重组项目
- HuangFJ << biohfj@gmail.com >> 本项目最初作者
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyltp-binary-0.2.1.0.tar.gz
(5.5 MB
view hashes)
Built Distributions
Close
Hashes for pyltp_binary-0.2.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3409c3032e7a829230cc964dc331767aff04b0352a6c7260de5cc504248a6476 |
|
MD5 | 64ec150295b6f13a0bded7b5613d4d32 |
|
BLAKE2b-256 | e402029b212756f0e4def1f0c04a55e6eb3d46f189150f8ea95cc1ff8d7e3ec8 |
Close
Hashes for pyltp_binary-0.2.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed14b660a09b0bdc06b115b510cb8ccccb03bb9914316715a3ea4a888a5fd555 |
|
MD5 | 9a2d7e22b1818e1f276f0cb8c4d53249 |
|
BLAKE2b-256 | 2450acfe16c72438f3d921dbede86970cf8b384c0f6ad16479ce56d953482d33 |
Close
Hashes for pyltp_binary-0.2.1.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20fcf0d89005072f3d41c76dd38d8ee80898ca3637df62fa4b263815cd81e79d |
|
MD5 | e615e0c2c0750b5a7b3a0bac4dc0e3dc |
|
BLAKE2b-256 | 080c6b9c37748a594ec03f6ec19ca6c1d11a7a1faa3ddf513ded9c4b121468ba |
Close
Hashes for pyltp_binary-0.2.1.0-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51f6496e784b5a7129461e24520e60dd34d9eb5856a0b83012ccbf6bf45ff11c |
|
MD5 | d56ca1e3397d020afcd1e0e7cb60fbdc |
|
BLAKE2b-256 | b3bdcf732f3cb5c45f80c7333781b662b1d67f301f77eb694744692af03d6857 |
Close
Hashes for pyltp_binary-0.2.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbdba2ebb65d4482a4fedd8c0605378604b622658753f25902c60e4d07c400a4 |
|
MD5 | 2206119d2b0d9b6fb0c529b7857a4ab7 |
|
BLAKE2b-256 | 13ea2cebbcf0416ba9587bc81640340ec7c48e0c0faff5d2d9bb154b967fd8ac |
Close
Hashes for pyltp_binary-0.2.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba526829789bd386eff20a974a9f8097cf3c0ecf0475ef922ec435f18f11f734 |
|
MD5 | 9b43b7a5c1a97ac67b48e7142c25824c |
|
BLAKE2b-256 | 7ddf2cc65175d1086493846c4d97dcb8214ed8bbe530d00786a53f1ffd64daa1 |
Close
Hashes for pyltp_binary-0.2.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3dc4fb41b74af63e766a81f2eed40e55c871d05b8885757578ade27b0f46951 |
|
MD5 | f5f064b8ef2f16590450645c5c929a73 |
|
BLAKE2b-256 | 89d9a57d3a3ac6b5fd98c4a9aceb70038ead430be72f0c964b51342cdcba3b04 |