GithubHelp home page GithubHelp logo

ngupta10 / coreference-resolution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neurosys-pl/coreference-resolution

0.0 0.0 0.0 32 KB

Coreference Resolution

License: Apache License 2.0

Python 21.25% Jupyter Notebook 78.75%

coreference-resolution's Introduction

Coreference resolution in NLP with AllenNLP and Huggingface

ℹī¸ More theoretical background supported by examples can be found in our introductory blog post.

🤗 More details about the most popular coreference resolution libraries (followed by their strengths, weaknesses, and problems) can be found in our second blog article.

👌 Some ideas concerning mentioned libraries and improvements upon AllenNLP and Huggingface solutions are described in detail in our last blog post.

What is coreference resolution

Coreference resolution (CR) is an NLP task that aims to group expressions referring to the same real-world entity to acquire less ambiguous text. It can be very useful in such tasks as text understanding, information extraction, summarization, or question answering.

Most popular CR libraries

We provide Jupyter notebooks showing the most basic usage of Huggingface NeuralCoref and Allen Institute (AllenNLP) coreference resolution models.
➡ī¸ huggingface_neuralcoref.ipynb
➡ī¸ allennlp_coreference_resolution.ipynb

More details about the models and some of their most common problems can be found in our second blog post.

Installation

We've encountered some difficulties during the installation of both libraries in a single Python/Conda environment. However, finally, we've come up with the setting which seems to work for our needs:

pip install spacy==2.1.0
python -m spacy download en_core_web_sm
pip install neuralcoref --no-binary neuralcoref
pip install allennlp
pip install --pre allennlp-models

We consider the smallest spaCy model (en_core_web_sm) sufficient and not deviating from larger models but feel free to download whatever model seems best for you.

Improvements upon the libraries

We've encountered several problems with clusters resolving in a text (the last step of replacing found mentions). As AllenNLP seems to find more suitable clusters (makes significantly fewer mistakes), we've decided to focus on this model. That's why we propose several improvements regarding its replace_corefs method.

➡ī¸ More details are provided by the improvements_to_allennlp_cr.ipynb notebook.

However, we still believe that Huggingface NeuralCoref is a valuable model that serves great as a reference. That's why we came up with a couple of intersection strategies - simply an ensemble of both models' outputs (clusters).

➡ī¸ Their implementation and usage can be found in the intersection_strategies.ipynb.

References

We're using the two most popular coreference resolution libraries: Huggingface NeuralCoref and AllenNLP implementation of CorefResolver.

Implementation Description License
Huggingface NeuralCoref 4.0 It's a CR extension for spaCy - very popular NLP library. NeuralCoref resolves coreference clusters using neural networks. More information can be found on their blog post and the demo. License: MIT
AllenNLP coreference resolution It's an open-source project being a part of AI2 institute which introduced e.g. ELMo. Their span-ranking coreference resolution model is also premised upon a neural model. More information is provided by their demo. License

coreference-resolution's People

Contributors

mmaslankowska-neurosys avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.