diff --git a/spacy/tokens/_serialize.py b/spacy/tokens/_serialize.py index 67ad9a21a..3ca3028b6 100644 --- a/spacy/tokens/_serialize.py +++ b/spacy/tokens/_serialize.py @@ -155,9 +155,9 @@ class DocBin(object): msg = srsly.msgpack_loads(zlib.decompress(bytes_data)) self.attrs = msg["attrs"] self.strings = set(msg["strings"]) - lengths = numpy.fromstring(msg["lengths"], dtype="int32") - flat_spaces = numpy.fromstring(msg["spaces"], dtype=bool) - flat_tokens = numpy.fromstring(msg["tokens"], dtype="uint64") + lengths = numpy.frombuffer(msg["lengths"], dtype="int32") + flat_spaces = numpy.frombuffer(msg["spaces"], dtype=bool) + flat_tokens = numpy.frombuffer(msg["tokens"], dtype="uint64") shape = (flat_tokens.size // len(self.attrs), len(self.attrs)) flat_tokens = flat_tokens.reshape(shape) flat_spaces = flat_spaces.reshape((flat_spaces.size, 1))