Giter Club home page Giter Club logo

pyltp's Introduction

pyltp

PyPI Status Readthedocs Build Status Build status PyPI Downloads

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
    
  • 第二步,下载模型文件

    百度云,当前模型版本 3.3.1

版本对应

  • pyltp 版本:0.1.9
  • LTP 版本:3.3.2
  • 模型版本:3.3.1

作者

pyltp's People

Contributors

oneplus avatar endyul avatar huangfj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.