From 87473db544e254c8b081ceaa1f854f3342be77ba Mon Sep 17 00:00:00 2001 From: Deng Date: Mon, 24 Jun 2019 10:05:33 +0800 Subject: [PATCH] remove predict labels of "CLS" and "SEP" --- demo/sequence-labeling/predict.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/demo/sequence-labeling/predict.py b/demo/sequence-labeling/predict.py index 6465eb0c..28044cd5 100644 --- a/demo/sequence-labeling/predict.py +++ b/demo/sequence-labeling/predict.py @@ -107,12 +107,8 @@ if __name__ == '__main__': labels = np_labels.reshape([-1]).astype(np.int32).tolist() label_str = "" - count = 0 - for label_val in labels: - label_str += inv_label_map[label_val] - count += 1 - if count == np_lens: - break + for i in range(1, np_lens-1): + label_str += inv_label_map[labels[i]] print("%s\tpredict=%s" % (test_examples[index], label_str)) -- GitLab