README.md 788 字节
Newer Older
M
MRXLT 已提交
1
# Chinese Sentence Sentiment Classification
M
MRXLT 已提交
2
([简体中文](./README_CN.md)|English)
M
MRXLT 已提交
3

M
MRXLT 已提交
4
## Get Model
M
MRXLT 已提交
5
```
M
MRXLT 已提交
6 7
python -m paddle_serving_app.package --get_model senta_bilstm
python -m paddle_serving_app.package --get_model lac
M
MRXLT 已提交
8 9
```

M
MRXLT 已提交
10
## Start HTTP Service
M
MRXLT 已提交
11
```
M
MRXLT 已提交
12 13
python -m paddle_serving_server.serve --model lac_model --port 9300
python senta_web_service.py
M
MRXLT 已提交
14
```
M
MRXLT 已提交
15 16 17
In the Chinese sentiment classification task, the Chinese word segmentation needs to be done through [LAC task] (../lac). 
In this demo, the LAC task is placed in the preprocessing part of the HTTP prediction service of the sentiment classification task.

M
MRXLT 已提交
18 19
## Client prediction
```
M
MRXLT 已提交
20
curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "天气不错"}], "fetch":["class_probs"]}' http://127.0.0.1:9292/senta/prediction
M
MRXLT 已提交
21
```