diff --git a/python/examples/lac/README.md b/python/examples/lac/README.md new file mode 100644 index 0000000000000000000000000000000000000000..15dbd252f05f8c191ab14d879176fbd45e75f984 --- /dev/null +++ b/python/examples/lac/README.md @@ -0,0 +1,35 @@ +## Chinese Word Segmentation + +([简体中文](./README_CN.md)|English) + +### Get model files and sample data +``` +sh get_data.sh +``` + +the package downloaded contains lac model config along with lac dictionary. + +#### Start RPC inference service + +``` +python -m paddle_serving_server.serve --model jieba_server_model/ --port 9292 +``` +### RPC Infer +``` +echo "我爱北京天安门" | python lac_client.py jieba_client_conf/serving_client_conf.prototxt lac_dict/ +``` + +it will get the segmentation result + +### Start HTTP inference service +``` +python lac_web_service.py jieba_server_model/ lac_workdir 9292 +``` +### HTTP Infer + +``` +curl -H "Content-Type:application/json" -X POST -d '{"words": "我爱北京天安门", "fetch":["word_seg"]}' http://127.0.0.1:9292/lac/prediction +``` + + + diff --git a/python/examples/lac/README_CN.md b/python/examples/lac/README_CN.md new file mode 100644 index 0000000000000000000000000000000000000000..4ebeac4a55d0afa749246a7f8e10c62507f05506 --- /dev/null +++ b/python/examples/lac/README_CN.md @@ -0,0 +1,35 @@ +## 中文分词模型 + +(简体中文|[English](./README.md)) + +### 获取模型和字典文件 +``` +sh get_data.sh +``` + +下载包里包含了lac模型和lac模型预测需要的字典文件 + +#### 开启RPC预测服务 + +``` +python -m paddle_serving_server.serve --model jieba_server_model/ --port 9292 +``` +### 执行RPC预测 +``` +echo "我爱北京天安门" | python lac_client.py jieba_client_conf/serving_client_conf.prototxt lac_dict/ +``` + +我们就能得到分词结果 + +### 开启HTTP预测服务 +``` +python lac_web_service.py jieba_server_model/ lac_workdir 9292 +``` +### 执行HTTP预测 + +``` +curl -H "Content-Type:application/json" -X POST -d '{"words": "我爱北京天安门", "fetch":["word_seg"]}' http://127.0.0.1:9292/lac/prediction +``` + + +