Code Monkey home page Code Monkey logo

entity-relation-as-multi-turn-qa's Introduction

Entity-Relation Extraction as Multi-Turn Question Answering

The repository contains the code of the recent research advances in Shannon.AI.

Entity-Relation Extraction as Multi-turn Question Answering (ACL 2019)
Xiaoya Li, Fan Yin, Zijun Sun, Xiayu Li, Arianna Yuan, Duo Chai, Mingxin Zhou and Jiwei Li
Accepted by ACL 2019
If you find this repo helpful, please cite the following:

@inproceedings{li-etal-2019-entity,
    title = "Entity-Relation Extraction as Multi-Turn Question Answering",
    author = "Li, Xiaoya  and
      Yin, Fan  and
      Sun, Zijun  and
      Li, Xiayu  and
      Yuan, Arianna  and
      Chai, Duo  and
      Zhou, Mingxin  and
      Li, Jiwei",
    booktitle = "Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics",
    month = jul,
    year = "2019",
    address = "Florence, Italy",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/P19-1129",
    doi = "10.18653/v1/P19-1129",
    pages = "1340--1350"
}

Install Requirements

pip install -r requirements.txt

Prepare Data

This project currently only support ace2004 and ace2005 dataset.

For data processing:

  1. We use moving sliding window with overlap to split the passage,
  2. We use a threshold to filter impossible relations with small frequency,
  3. We use max distance to further filter impossible relations that have end entity type that doesn't in a small range from the head entity.
  4. We use two special tokens to mark the head entity in the context to avoid coreference problem in the window.

Following these steps to obtain training data:

  1. Unzip ace2004.zip and ace2005.zip into data/raw_data
  2. Preprocess the data with preprocess.py.The example used can be found in scripts/prepare_ace2005.sh

Pretrained Model

We use BERT-Base-Uncased

Train

Use train.py to train the model.

The example used can be found in scripts/train_ace2005.sh.

Evaluate checkpoints:

Use ckpt_eval.py to evaluate the saved model.

The example used can be found in scripts/ckpt_eval.sh.

entity-relation-as-multi-turn-qa's People

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.