Skip to content
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

Is it possible to apply Negspacy over token? #18

Closed
Raghu17s opened this issue Jul 20, 2020 · 1 comment
Closed

Is it possible to apply Negspacy over token? #18

Raghu17s opened this issue Jul 20, 2020 · 1 comment

Comments

@Raghu17s
Copy link

Hi,

How can I apply negations on the token? is it possible?

I tried following but it ended up in error.
`for token in doc:

print(token.text, token._.negex)

The error is

AttributeError Traceback (most recent call last)
in
1 for token in doc:
----> 2 print(token.text, token._.negex)

~/anaconda3/envs/python3/lib/python3.6/site-packages/spacy/tokens/underscore.py in getattr(self, name)
33 def getattr(self, name):
34 if name not in self._extensions:
---> 35 raise AttributeError(Errors.E046.format(name=name))
36 default, method, getter, setter = self._extensions[name]
37 if getter is not None:

AttributeError: [E046] Can't retrieve unregistered extension attribute 'negex'. Did you forget to call the set_extension method?
`

@jenojp
Copy link
Owner

jenojp commented Jul 20, 2020

Unfortunately, no as it is an extension for "spans" only.

@jenojp jenojp closed this as completed Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants