Skip to main content

pyltp: the python extension for LTP 3

Project description

pyltp

PyPI Status Readthedocs Build Status Build status PyPI Downloads

pyltp 是 语言技术平台(Language Technology Platform, LTP)的 Python 封装。

在使用 pyltp 之前,您需要简要了解 语言技术平台(LTP) 能否帮助您解决问题。

目前基于Pytorch的LTP4 已经发布,而PyLTP将会只有非常有限的维护,请大家移步使用[LTP 4](LTP 4)

依赖支持情况

Python 2.7, 3.x, and PyPy (PyPy2.7 >= 5.7)

一个简单的例子

下面是一个使用 pyltp 进行分词的例子

# -*- coding: utf-8 -*-
from pyltp import Segmentor
segmentor = Segmentor("/path/to/your/cws/model")
words = segmentor.segment("元芳你怎么看")
print("|".join(words))
segmentor.release()

除了分词之外,pyltp 还提供词性标注、命名实体识别、依存句法分析、语义角色标注等功能。

详细使用方法可以参考 example

安装

  • 第一步,安装 pyltp

    使用 pip 安装

     $ pip install pyltp
    

    或从源代码安装

     $ git clone https://github.com/HIT-SCIR/pyltp
     $ cd pyltp
     $ git submodule init
     $ git submodule update
     $ python setup.py install
    
    • Mac系统出现版本问题使用 MACOSX_DEPLOYMENT_TARGET=10.7 python setup.py install
    • 编译时间较长(约5分钟左右),请耐心等待
  • 第二步,下载模型文件

    七牛云,当前模型版本 3.4.0

制作安装包

git submodule init
git submodule update
python setup.py bdist_wheel

版本对应

  • pyltp 版本:0.4.0
  • LTP 版本:3.4.0
  • 模型版本:3.4.0

作者

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyltp-0.4.0.tar.gz (4.3 MB view hashes)

Uploaded Source

Built Distributions

pyltp-0.4.0-pp39-pypy39_pp73-win_amd64.whl (564.4 kB view hashes)

Uploaded PyPy Windows x86-64

pyltp-0.4.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

pyltp-0.4.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pyltp-0.4.0-pp38-pypy38_pp73-win_amd64.whl (564.5 kB view hashes)

Uploaded PyPy Windows x86-64

pyltp-0.4.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

pyltp-0.4.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pyltp-0.4.0-pp37-pypy37_pp73-win_amd64.whl (564.5 kB view hashes)

Uploaded PyPy Windows x86-64

pyltp-0.4.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

pyltp-0.4.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pyltp-0.4.0-cp310-cp310-win_amd64.whl (564.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyltp-0.4.0-cp310-cp310-musllinux_1_1_i686.whl (45.7 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

pyltp-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

pyltp-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyltp-0.4.0-cp39-cp39-win_amd64.whl (564.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyltp-0.4.0-cp39-cp39-musllinux_1_1_i686.whl (45.7 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

pyltp-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

pyltp-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyltp-0.4.0-cp38-cp38-win_amd64.whl (564.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyltp-0.4.0-cp38-cp38-musllinux_1_1_i686.whl (45.7 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

pyltp-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

pyltp-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyltp-0.4.0-cp37-cp37m-win_amd64.whl (564.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pyltp-0.4.0-cp37-cp37m-musllinux_1_1_i686.whl (45.7 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

pyltp-0.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

pyltp-0.4.0-cp37-cp37m-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pyltp-0.4.0-cp36-cp36m-win_amd64.whl (564.9 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pyltp-0.4.0-cp36-cp36m-musllinux_1_1_i686.whl (45.7 MB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ i686

pyltp-0.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.6 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

pyltp-0.4.0-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl (44.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ i686

pyltp-0.4.0-cp36-cp36m-macosx_10_9_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page