mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Fix numpy.zeros() dtype for Doc.from_array
This commit is contained in:
parent
9aff317ca7
commit
a6abdfbc3c
|
@ -471,7 +471,7 @@ doc = nlp.make_doc("London is a big city in the United Kingdom.")
|
|||
print("Before", doc.ents) # []
|
||||
|
||||
header = [ENT_IOB, ENT_TYPE]
|
||||
attr_array = numpy.zeros((len(doc), len(header)))
|
||||
attr_array = numpy.zeros((len(doc), len(header)), dtype="uint64")
|
||||
attr_array[0, 0] = 3 # B
|
||||
attr_array[0, 1] = doc.vocab.strings["GPE"]
|
||||
doc.from_array(header, attr_array)
|
||||
|
|
Loading…
Reference in New Issue
Block a user