mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
* Add ValueError condition to ner_tag reading
This commit is contained in:
parent
435cccf098
commit
8c354c432b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user