Skip to main content

pyltp: the python extension for LTP

Project description

Pypi Status Build Status

pyltp是语言技术平台(Language Technology Platform,LTP)的Python封装。 关于LTP更多的信息,欢迎访问LTP项目主页。

简介与背景知识

pyltp是语言技术平台(Language Technology Platform,LTP)接口的一个Python封装。 本项目旨在使Python用户可以本地调用LTP。 该项目还处于测试状态,欢迎反馈bug。

在使用pyltp之前,您需要简要了解

如果您对这些问题不了解,请首先阅读我们提供的有关语言技术平台的文档。 在本文档的后续中,我们假定您已经阅读并成功编译并使用语言技术平台。

安装

现阶段,pyltp主要在Linux编译测试。我们也欢迎用户提供其他平台的测试结果。

pypi安装

$ pip install pyltp

如果您使用使用github的开发版的pyltp,您可以采用如下命令编译pyltp

$ git clone https://github.com/HIT-SCIR/pyltp
$ git submodule init
$ git submodule update
$ python setup.py build

例子

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

更多例子,请参考example/example.py

作者

Project details


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.1.5.tar.gz (2.8 MB view hashes)

Uploaded Source

Built Distributions

pyltp-0.1.5.win-amd64-py3.4.exe (916.1 kB view hashes)

Uploaded Source

pyltp-0.1.5.win-amd64-py2.7.exe (969.6 kB view hashes)

Uploaded Source

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