I am trying to install neuralcoref and following the instructions given here.
I created a jupyter notebook and try to run the following code.
# Load your usual SpaCy model (one of SpaCy English models)
import spacy
nlp = spacy.load('en')
# Add neural coref to SpaCy's pipe
import neuralcoref
neuralcoref.add_to_pipe(nlp)
# You're done. You can now use NeuralCoref as you usually manipulate a SpaCy
document annotations.
doc = nlp(u'My sister has a dog. She loves him.')
doc._.has_coref
doc._.coref_clusters
I get an error message from the jupyter, that kernel died. Even I try to run in the in a python file but still its not working.
O.S - Windows 10 RAM : 16GB
Note: I did try out to updating numpy but still it didn't worked.
Can anyone help me with that. Appreciate your time. Thanks
As per here: https://github.com/huggingface/neuralcoref/issues/189.
You can get it to work fine if you downgrade Spacy to 2.1.0.
pip uninstall spacy
pip uninstall neuralcoref
pip install spacy==2.1.0
pip install neuralcoref --no-binary neuralcoref
Has worked for others, including myself. Notebook now runs fine.
There is no need to downgrade spacy
at all. Build from source, because neuralcoref
installed with pip
is built against spacy==2.1.0
.
Proof:
Build:
git clone https://github.com/huggingface/neuralcoref.git
cd neuralcoref
pip install -r requirements.txt # correct for the desired versions of Cython and SpaCy
python setup.py install
Test:
import spacy
import neuralcoref
nlp = spacy.load('en_core_web_md')
neuralcoref.add_to_pipe(nlp)
print(spacy.__version__)
doc = nlp(u'My sister has a dog. She loves him.')
print(doc._.has_coref)
print(doc._.coref_clusters)
2.3.2
True
[My sister: [My sister, She], a dog: [a dog, him]]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With