Home

Awesome

KGPool: Dynamic Knowledge Graph Context Selection for Relation Extraction

This is an implementation of the paper KGPool: Dynamic Knowledge Graph Context Selection for Relation Extraction, ACL Findings 2021.

PWC

PWC

@inproceedings{nadgeri-etal-2021-kgpool,
    title = "{KGP}ool: Dynamic Knowledge Graph Context Selection for Relation Extraction",
    author = "Nadgeri, Abhishek  and
      Bastos, Anson  and
      Singh, Kuldeep  and
      Mulang{'}, Isaiah Onando  and
      Hoffart, Johannes  and
      Shekarpour, Saeedeh  and
      Saraswat, Vijay",
    booktitle = "Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021",
    month = aug,
    year = "2021",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2021.findings-acl.48",
    doi = "10.18653/v1/2021.findings-acl.48",
    pages = "535--548",
}

alt tag

Acknowledgment

The Code base is built upon the following work -

Requirements

Data

We use the same dataset and the entity attributes as used by the previous baseline RECON

Usage

First, download the datasets.

Train and evaluate the model: <br> (make sure Glove embeddings are ready before training)

wget http://nlp.stanford.edu/data/glove.6B.zip
unzip glove.6B.zip

Train

python Context-Aggregator/train.py

Testing

python Context-Aggregator/test.py

Directory structure

Context-Aggregator/: The same folder strucutre as that of GPGNN

KGPool/data_loader.py: Data pre-processing and gathering step.

KGPool/networks.py: Set the graph architecture.

KGPool/layers.py: Perform dynamic pooling on nodes.

Hyper Parameters