diff --git a/demo/serving/module_serving/lexical_analysis_lac/README.md b/demo/serving/module_serving/lexical_analysis_lac/README.md index 6fbe296ca565c0020c33f57275a12a309b2e93b2..b91346dae42ecaee1d9b0008f7a4c611b3bb4ff2 100644 --- a/demo/serving/module_serving/lexical_analysis_lac/README.md +++ b/demo/serving/module_serving/lexical_analysis_lac/README.md @@ -146,4 +146,4 @@ if __name__ == "__main__": ] } ``` -此Demo的具体信息和代码请参见[LAC Serving](./lac_serving_demo.py)。 +此Demo的具体信息和代码请参见[LAC Serving_2.1.0](lac_2.1.0_serving_demo.py)。 diff --git a/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py b/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py index 96a585bfd12e0e2a650908fb25289cd6452923d9..05e40f8a63a68a8909da4a15018dc2fad353ee4d 100644 --- a/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py +++ b/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py @@ -7,8 +7,7 @@ if __name__ == "__main__": text = ["今天是个好日子", "天气预报说今天要下雨"] # 以key的方式指定text传入预测方法的时的参数,此例中为"data" # 对应本地部署,则为lac.analysis_lexical(data=text, batch_size=1) - # 若使用lac版本低于2.2.0,需要将`text`参数改为`texts` - data = {"text": text, "batch_size": 1} + data = {"texts": text, "batch_size": 1} # 指定预测方法为lac并发送post请求,content-type类型应指定json方式 url = "http://127.0.0.1:8866/predict/lac" # 指定post请求的headers为application/json方式