-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_array(scalar) has bad error message #1410
Comments
Agreed, thanks. I think we should make this work, i.e. |
If you want |
Does this describe the behaviour you expect? I added the option of an def to_array(self, attr_ids, out=None):
"""Export given token attributes to a numpy `ndarray`.
If `attr_ids` is a sequence of M attributes, the output array will
be of shape `(N, M)`, where N is the length of the `Doc`
(in tokens). If `attr_ids` is a single attribute, the output shape will
be (N,). You can specify attributes by integer ID (e.g. spacy.attrs.LEMMA)
or string name (e.g. 'LEMMA' or 'lemma').
By default, a new numpy array of dtype uint64 is created for the output.
You can instead pass in an array using the `out` keyword argument.
""" |
Sounds good
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
raises
when it should either work or be clearer in the error: it expects a list, not a single attr.
Info about spaCy
The text was updated successfully, but these errors were encountered: