Skip to content

Commit 7909bac

Browse files
committed
fix a bug to process the "chunk" feature
1 parent cc7a4df commit 7909bac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

twasp_model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ def load_data(self, data_path, do_predict=False):
260260
assert current_token in self.gram2id
261261
assert current_feature in self.feature2id
262262

263-
token_index_list = token['chunk_tags'][-1]['range']
263+
token_index_range = token['chunk_tags'][-1]['range']
264264
char_index_list = token['char_index']
265265

266266
for i in char_index_list:
267-
for j in token_index_list:
267+
for j in range(token_index_range[0], token_index_range[1]):
268268
word_matching_position.append((i, j))
269269
syn_matching_position.append((i, j))
270270
word_matching_position = list(set(word_matching_position))

0 commit comments

Comments
 (0)