huggingface / neuralcoref

✨Fast Coreference Resolution in spaCy with Neural Networks
https://huggingface.co/coref/
MIT License
2.84k stars 474 forks source link

[E046] Can't retrieve unregistered extension attribute 'has_coref' #272

Closed simonm3 closed 4 years ago

simonm3 commented 4 years ago

This works fine:

doc = nlp('Jane has a dog. She loves him.')
doc._.has_coref, doc._.coref_clusters

(True, [Jane: [Jane, She], a dog: [a dog, him]])

However it does not work for a token nor for a span:

for t in doc:
    print(t._.has_coref)

AttributeError Traceback (most recent call last)

in 1 for t in doc: ----> 2 print(t._.has_coref) ~\Anaconda3\Lib\site-packages\spacy\tokens\underscore.py in __getattr__(self, name) 28 def __getattr__(self, name): 29 if name not in self._extensions: ---> 30 raise AttributeError(Errors.E046.format(name=name)) 31 default, method, getter, setter = self._extensions[name] 32 if getter is not None: AttributeError: [E046] Can't retrieve unregistered extension attribute 'has_coref'. Did you forget to call the `set_extension` method?
simonm3 commented 4 years ago

sorry it is token.in_coref not has_coref!