README.md 924 字节
Newer Older
M
MRXLT 已提交
1
# Chinese sentence sentiment classification
M
MRXLT 已提交
2
([简体中文](./README_CN.md)|English)
M
MRXLT 已提交
3 4 5 6 7 8 9 10
## Get model files and sample data
```
sh get_data.sh
```
## Start http service
```
python senta_web_service.py senta_bilstm_model/ workdir 9292
```
M
MRXLT 已提交
11
In the Chinese sentiment classification task, the Chinese word segmentation needs to be done through [LAC task] (../lac). Set model path by ```lac_model_path``` and dictionary path by ```lac_dict_path```. 
M
MRXLT 已提交
12
In this demo, the LAC task is placed in the preprocessing part of the HTTP prediction service of the sentiment classification task. The LAC prediction service is deployed on the CPU, and the sentiment classification task is deployed on the GPU, which can be changed according to the actual situation.
M
MRXLT 已提交
13 14
## Client prediction
```
M
MRXLT 已提交
15
curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "天气不错"}], "fetch":["class_probs"]}' http://127.0.0.1:9292/senta/prediction
M
MRXLT 已提交
16
```