From a10622d7dd3e6a11d66c4440c63570ac97dcd0dc Mon Sep 17 00:00:00 2001 From: zhangjinchao01 Date: Wed, 14 Dec 2016 22:15:58 +0800 Subject: [PATCH] fix index bug --- demo/semantic_role_labeling/data/extract_dict_feature.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/semantic_role_labeling/data/extract_dict_feature.py b/demo/semantic_role_labeling/data/extract_dict_feature.py index a02a49a86..da4411197 100644 --- a/demo/semantic_role_labeling/data/extract_dict_feature.py +++ b/demo/semantic_role_labeling/data/extract_dict_feature.py @@ -43,13 +43,13 @@ def extract_dict_features(pair_file, feature_file): mark[verb_index] = 1 ctx_0 = sentence_list[verb_index] - if verb_index < len(labels_list) - 2: + if verb_index < len(labels_list) - 1: mark[verb_index + 1] = 1 ctx_p1 = sentence_list[verb_index + 1] else: ctx_p1 = 'eos' - if verb_index < len(labels_list) - 3: + if verb_index < len(labels_list) - 2: mark[verb_index + 2] = 1 ctx_p2 = sentence_list[verb_index + 2] else: -- GitLab