Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/banyh/PyStanfordNLP

A Python Wrapper of Stanford Chinese Segmenter
https://github.com/banyh/PyStanfordNLP

nlp postagging python-wrapper stanford stanford-chinese-segmenter

Last synced: 3 months ago
JSON representation

A Python Wrapper of Stanford Chinese Segmenter

Awesome Lists containing this project

README

        

# A Python Wrapper of Stanford Chinese Segmenter

## Prerequisite

* Java 8

## Installation

```
pip install git+https://github.com/banyh/PyStanfordNLP
```

## Usage

```python
from stanford_segmenter import Segmenter
from stanford_postagger import Postagger

seg = Segmenter() # the only supported language is 'zh'
pos = Postagger() # supported language: 'zh', 'en', 'fr', 'de', 'es'

seg.segment('你昨天去電影院了嗎?')
# ['你', '昨天', '去', '電影院', '了', '嗎', '?']
pos.postag('你 昨天 去 電影院 了 嗎 ?')
# '你#PN 昨天#NT 去#VV 電影院#VV 了#AS 嗎#NN ?#PU '
```