* Add ValueError condition to ner_tag reading

This commit is contained in:
Matthew Honnibal 2015-04-10 04:59:59 +02:00
parent 435cccf098
commit 8c354c432b

View File

@ -76,6 +76,8 @@ cdef class BiluoPushDown(TransitionSystem):
for (raw_text, toks, (ids, words, tags, heads, labels, biluo)) in gold_tuples:
for i, ner_tag in enumerate(biluo):
if ner_tag != 'O' and ner_tag != '-':
if ner_tag.count('-') != 1:
raise ValueError(ner_tag)
_, label = ner_tag.split('-')
for move_str in ('B', 'I', 'L', 'U'):
move_labels[moves.index(move_str)][label] = True