mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
* Don't assign 0-valued tags in Doc.from_array
This commit is contained in:
parent
c1c11a8ae0
commit
29a114e645
|
@ -387,6 +387,7 @@ cdef class Doc:
|
||||||
tokens[i + values[i]].r_kids += 1
|
tokens[i + values[i]].r_kids += 1
|
||||||
elif attr_id == TAG:
|
elif attr_id == TAG:
|
||||||
for i in range(length):
|
for i in range(length):
|
||||||
|
if values[i] != 0:
|
||||||
self.vocab.morphology.assign_tag(&tokens[i],
|
self.vocab.morphology.assign_tag(&tokens[i],
|
||||||
self.vocab.morphology.reverse_index[values[i]])
|
self.vocab.morphology.reverse_index[values[i]])
|
||||||
elif attr_id == POS:
|
elif attr_id == POS:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user