From 4bd0584c9339c28cad791653a41f5a3fe1f29dba Mon Sep 17 00:00:00 2001 From: MRXLT Date: Wed, 3 Jun 2020 13:17:21 +0000 Subject: [PATCH] fix lac reader --- python/paddle_serving_app/reader/lac_reader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle_serving_app/reader/lac_reader.py b/python/paddle_serving_app/reader/lac_reader.py index fd81ef36..8f7d79a6 100644 --- a/python/paddle_serving_app/reader/lac_reader.py +++ b/python/paddle_serving_app/reader/lac_reader.py @@ -111,8 +111,10 @@ class LACReader(object): return word_ids def parse_result(self, words, crf_decode): - if py_version == 2: + try: words = unicode(words, "utf-8") + except: + pass tags = [self.id2label_dict[str(x[0])] for x in crf_decode] sent_out = [] -- GitLab