提交 98f0bac1 编写于 作者: J Jiawei Wang 提交者: MRXLT

Update lac_web_service.py

上级 88b0a379
...@@ -25,8 +25,14 @@ class LACService(WebService): ...@@ -25,8 +25,14 @@ class LACService(WebService):
if "words" not in feed: if "words" not in feed:
raise ("feed data error!") raise ("feed data error!")
feed_data = self.reader.process(feed["words"]) feed_data = self.reader.process(feed["words"])
fetch = ["crf_decode"]
return {"words": feed_data}, fetch return {"words": feed_data}, fetch
def postprocess(self, feed={}, fetch=[], fetch_map={}):
segs = self.reader.parse_result(
feed["words"], fetch_map["crf_decode"])
return {"word_seg": "|".join(segs)}
lac_service = LACService(name="lac") lac_service = LACService(name="lac")
lac_service.load_model_config(sys.argv[1]) lac_service.load_model_config(sys.argv[1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册