README.md 711 字节
Newer Older
J
Jiawei Wang 已提交
1 2 3 4
## Chinese Word Segmentation

([简体中文](./README_CN.md)|English)

M
MRXLT 已提交
5
### Get Model
J
Jiawei Wang 已提交
6
```
M
MRXLT 已提交
7 8
python -m paddle_serving_app.package --get_model lac
tar -xzvf lac.tar.gz
J
Jiawei Wang 已提交
9 10 11 12 13
```

#### Start RPC inference service

```
M
MRXLT 已提交
14
python -m paddle_serving_server.serve --model lac_model/ --port 9292
J
Jiawei Wang 已提交
15 16 17
```
### RPC Infer
```
M
MRXLT 已提交
18
echo "我爱北京天安门" | python lac_client.py lac_client/serving_client_conf.prototxt
J
Jiawei Wang 已提交
19 20
```

M
MRXLT 已提交
21
It will get the segmentation result. 
J
Jiawei Wang 已提交
22 23 24

### Start HTTP inference service
```
M
MRXLT 已提交
25
python lac_web_service.py lac_model/ lac_workdir 9292
J
Jiawei Wang 已提交
26 27 28 29
```
### HTTP Infer

```
M
MRXLT 已提交
30
curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "我爱北京天安门"}], "fetch":["word_seg"]}' http://127.0.0.1:9292/lac/prediction
J
Jiawei Wang 已提交
31
```