Giter Club home page Giter Club logo

graphie's Introduction

GraphIE: This is the code for word-level GCN

This repo contains the word-level GCN code and data of the paper:

GraphIE: A Graph-Based Framework for Information Extraction. Yujie Qian, Enrico Santus, Zhijing Jin, Jiang Guo, and Regina Barzilay.

This code is implemented by Zhijing Jin. The original framework is accreditted to Di Jin.

For any questions, please contact her via email. (Another part of the code in the paper, i.e. sentence-level GCN is in this github repo.

Get Started

1) Install packages

  • Python>=3.6
  • PyTorch 0.4.0 # install it according to your cuda version. e.g. conda install pytorch=0.4.0 torchvision cuda80 -c pytorch
conda create -n graphie_env python=3.6
conda activate graphie_env
pip install -r requirements.txt
# install pytorch 0.4.0 in your own way

2) Download data

./download_data.sh # (1) download and preprocess Conll2003; (2) download Glove embeddings

Note: If you need to preprocess new data sources, please see

  • Small data samples are provided.
  • If have any questions regarding preprocess.py, you can contact the author by email.

Run

python examples/multi_runs_conll.py --gpu_id 0

Model Outputs

Overview

To ensure the files are correct, I did the following checks on Apr 2, 2019.

Conll03 Dev/Test # docs GraphIE (best) SeqIE (best)
Test 231 92.02 91.57
Dev 216 94.90 94.66

Output Files

Conll03 Dev/Test GraphIE (best) SeqIE (best)
Test Output (92.02) Output(91.57)
Dev Output (94.90) Output(94.66)

Specs

  • You can evaluate the outputs by running the official perl script to calculate NER F1 scores:
code/examples/eval/conll03eval.v2 < outputs/conll03_SeqIE/11141152r09_dev
  • In each output file, the format is index \t word \t gold_tag \t predicted_tag. The start of a document is signified by 1 -DOCSTART- O O.
  • The dev output is saved in the last epoch in the training.
  • The test output is saved in the epoch with the highest F1 score on the dev data.
  • To get a better understanding of how the outputs are saved, please refer to the main code file.

Appendix: Full experiment details

conll03 - GraphIE

To show a robust result, we run the code multiple times and gathered the following outputs:

filename Test F1
11131129r09 91.77
11131158r09 91.96
11131159r09 91.34
11131229r10 91.63
11131230r10 92.02
11141004r03 92

conll03 - SeqIE

To show a robust result, we run the code multiple times and gathered the following outputs:

filename Test F1
11141150r09 91.45
11141152r09 91.57
11141153r09 90.72
11141154r11 90.94
11141156r11 91.14

graphie's People

Watchers

 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.