https://github.com/rikeda71/morphanalysisapi
Japanese Morph Analysis Web API
https://github.com/rikeda71/morphanalysisapi
morphological-analysis
Last synced: 10 days ago
JSON representation
Japanese Morph Analysis Web API
- Host: GitHub
- URL: https://github.com/rikeda71/morphanalysisapi
- Owner: rikeda71
- Created: 2019-06-26T05:30:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-05T08:32:43.000Z (almost 7 years ago)
- Last Synced: 2025-10-27T23:41:28.959Z (8 months ago)
- Topics: morphological-analysis
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.ja.md
Awesome Lists containing this project
README
# MorphAnalysisAPI
以下の3つの形態素解析機をWebAPIで試せるようにしたもの
- [MeCab](https://taku910.github.io/mecab/)
- mecab with [NEologd](https://github.com/neologd/mecab-ipadic-neologd)
- [JUMAN++](http://nlp.ist.i.kyoto-u.ac.jp/index.php?JUMAN++)
- [Sudachi](https://github.com/WorksApplications/SudachiPy) (SudachiPy)
## 必要なもの
- python3
- requests
- Docker
## 使い方
### Docker Containerの起動
```shell
docker build . -t morph-analysis-api # wait a minute
docker run -it --rm -d -p 5000:5000 -v $PWD/:/app morph-analysis-api:latest python app.py
```
### Docker Containerの停止(削除)
```shell
docker stop `container_id`
```
### 形態素解析のテスト
```shell
python3 request.py
```
#### テスト用スクリプトの詳細
```shell
python3 request.py -h
usage: request.py [-h] [-s SENTENCE]
[-m {mecab,mecab-neologd,sudachi,jumanpp}]
optional arguments:
-h, --help show this help message and exit
-s SENTENCE, --sentence SENTENCE
a japanese sentence. default=`すもももももももものうち`
-m {mecab,mecab-neologd,sudachi,jumanpp}, --machine {mecab,mecab-neologd,sudachi,jumanpp}
choice morphological analysis machine. default=`mecab`
```
### APIの仕様
| HTTP method | end point | request parameters | request headers |
---- | ---- | ---- | ----
| POST | /mecab | sentence | Content-Type:application/json |
| POST | /mecab-neologd | sentence | Content-Type:application/json |
| POST | /jumanpp | sentence | Content-Type:application/json |
| POST | /sudachi | sentence, mode [optional. 'A', 'B', or 'C'] | Content-Type:application/json |