From 02d353238076eca1f7375fafb2dca4136350f1b8 Mon Sep 17 00:00:00 2001 From: Austendeng <328600746@qq.com> Date: Fri, 28 Jun 2019 10:56:12 +0800 Subject: [PATCH] fix bug (#64) --- paddlehub/reader/nlp_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddlehub/reader/nlp_reader.py b/paddlehub/reader/nlp_reader.py index 2b51e902..ac9cd499 100644 --- a/paddlehub/reader/nlp_reader.py +++ b/paddlehub/reader/nlp_reader.py @@ -382,7 +382,7 @@ class SequenceLabelReader(BaseReader): sub_label = "I-" + label[2:] ret_labels.extend([sub_label] * (len(sub_token) - 1)) - if len(ret_tokens) != len(labels): + if len(ret_tokens) != len(ret_labels): raise ValueError( "The length of ret_tokens can't match with labels") return ret_tokens, ret_labels -- GitLab