pyltp

pyltp: the python extension for LTP

Github stars Tracking Chart

# pyltp

PyPI Status
Readthedocs
Build Status
Build status
PyPI Downloads

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

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

依赖支持情况, Py2.6, Py2.6, Py3.4, Py3.5, Py3.6, conda-python, :--:, :--:, :--:, :--:, :--:, :--:, :--:, Linux, 支持, 支持, 支持, 支持, 支持, 不支持, Mac OS, 支持, 支持, 支持, 支持, 支持, 不支持, Windows VS2015, 不支持, 不支持, 不支持, 支持, 支持, 不支持, Windows VS2017, 不支持, 不支持, 不支持, 支持, 支持, 不支持, ## 一个简单的例子

下面是一个使用 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

作者

Overview

Name With OwnerNetflix/lemur-docker
Primary LanguagePython
Program languageC++ (Language Count: 4)
Platform
License:
Release Count0
Created At2015-09-04 15:41:30
Pushed At2022-02-02 18:12:10
Last Commit At2022-02-02 10:12:10
Stargazers Count170
Watchers Count381
Fork Count88
Commits Count86
Has Issues Enabled
Issues Count34
Issue Open Count8
Pull Requests Count33
Pull Requests Open Count1
Pull Requests Close Count3
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top