readme.rst

✨NeuralCoref: Coreference Resolution in spaCy with Neural Networks.

NeuralCoref is a pipeline extension for spaCy 2.0 that annotates and resolves coreference clusters using a neural network. NeuralCoref is production-ready, integrated in spaCy's NLP pipeline and easily extensible to new training datasets.

For a brief introduction to coreference resolution and NeuralCoref, please refer to our blog post.
NeuralCoref is written in Python/Cython and comes with pre-trained statistical models for English. It can be trained in other languages. NeuralCoref is accompanied by a visualization client NeuralCoref-Viz, a web interface powered by a REST server that can be tried online. NeuralCoref is released under the MIT license.

✨ Version 3.0 out now! 100x faster and tightly integrated in spaCy pipeline.

Install NeuralCoref

As a pre-trained spaCy model

This is the easiest way to install NeuralCoref if you don't need to train the model on a new language or dataset.

Operating system

macOS / OS X, Linux, Windows (Cygwin, MinGW, Visual Studio)

Python version

CPython 2.7, 3.4+. Only 64 bit.

NeuralCoref is currently available in English with three models of increasing accuracy that mirror spaCy english models. The larger the model, the higher the accuracy:

Important: NeuralCoref mentions are spaCy Span objects which means you can access all the usual Span attributes like span.start (index of the first token of the span in the document), span.end (index of the first token after the span in the document), etc...

Ex: doc._.coref_clusters[1].mentions[-1].start will give you the index of the first token of the last mention of the second coreference cluster in the document.

Using NeuralCoref as a server

A simple example of server script for integrating NeuralCoref in a REST API is provided as an example in examples/server.py.

There are many other ways you can manage and deploy NeuralCoref. Some examples can be found in spaCy Universe.