Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/banyh/PyStanfordNLP
- Owner: banyh
- License: mit
- Created: 2017-01-19T17:59:25.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-02T02:32:00.000Z (over 7 years ago)
- Last Synced: 2024-05-23T04:46:49.474Z (6 months ago)
- Topics: nlp, postagging, python-wrapper, stanford, stanford-chinese-segmenter
- Language: Python
- Size: 1.92 MB
- Stars: 20
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 Postaggerseg = 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 '
```