Code Monkey home page Code Monkey logo

ss-aga-kgc's Introduction

Multilingual Knowledge Graph Completion with Self-Supervised Adaptive Graph Alignment (SS-AGA)

SS-AGA is a multilingual knowledge graph completion framework that transfers knowledge among multiple KGs sources based on limited seed entity alignment.

You can see our ACL 2022 paper โ€œMultilingual Knowledge Graph Completion with Self-Supervised Adaptive Graph Alignmentโ€ for more details.

This implementation of SS-AGA is based on Pytorch Geometric API. Our code is built upon the github KEnS and we thank the authors' effort for making it public.

Data

DBP-5L: A Public dataset from https://github.com/stasl0217/KEnS.

E-PKG: A new industrial multilingual E-commerce product KG dataset. (To be released.)

Data format: Each dataset contains the following files and folders:

  • entity: Folder that contains the entity list for each KG.
  • kg: Folder that contains the KG triple list (head_entity_index, relation_index, tail_entity_index) for each kg.
  • seed_alignlinks: Folder that contains seed entity alignment pair list between two KGs.
  • relation.txt: File that contains relation that is shared across all KGs.
  • entity_embeddings.npy: The numpy file of mbert embedding for each entity from all KGs. Size of [Num_entity_all, 768]. We use the BERT-Base, Multilingual Cased from https://github.com/google-research/bert/blob/master/multilingual.md to generate it. You can download the entity_embeddings.npy for ther DBP-5L dataset from here.

To run the code, create the folders "dataset/dbp5l", "dataset/epkg" and download the two datasets respectively.

Setup

To run the code, you need the following dependencies:

Usage

Execute the following scripts to train the model on the targeted japanese KG:

python run_model.py --target_language ja --use_default

There are some key options of this scrips:

  • --target_language: The targeted KG to conduct the KG completion task.
  • --num_hop: Number of hops for sampling neighbors for each node.
  • --preserved_ratio : How many align links to preserve in learning alignment embeddings. The rest are served as masked alignments and we ask the model to recover them.
  • --generation_freq: How many epochs to conduct new pair generation once.
  • --use_default: Use the preset hyper-parameter combinations.

The details of other optional hyperparameters can be found in run_model.py.

Citation

Please consider citing the following paper when using our code for your application.

@inproceedings{SS-AGA,
  title={Multilingual Knowledge Graph Completion with Self-Supervised
Adaptive Graph Alignment},
  author={Zijie Huang and Zheng Li and Haoming Jiang and Tianyu Cao and Hanqing Lu and Bing Yin and Karthik Subbian and Yizhou Sun and Wei Wang},
  booktitle={Annual Meeting of the Association for Computational Linguistics (ACL)},
  year={2022}
}

License

This project is licensed under the Apache-2.0 License.

ss-aga-kgc's People

Contributors

zijieh avatar amazon-auto 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.