Git Product home page Git Product logo

one-shot-relational-learning's Introduction

One-Shot-Knowledge-Graph-Reasoning

PyTorch implementation of the One-Shot relational learning model described in our EMNLP 2018 paper One-Shot Relational Learning for Knowledge Graphs. In this work, we attempt to automatically infer new facts about a particular relation given only one training example. For instance, given the fact the "the Arlanda Airport is located in city Stochholm", the algorithm proposed in this papers tries to automatically infer that "the Haneda Airport is located in Tokyo" by utilizing the knowledge graph information about the involved entities (i.e. the Arlanda Airport, Stochholm, the Haneda Airport and Tokyo).

Method illustration

The main idea of this model is a matching network that encodes the one-hop neighbors of the involved entities, as defined in matcher.py.

Steps to run the experiments

Requirements

  • Python 3.6.5
  • PyTorch 0.4.1
  • tensorboardX
  • tqdm

Datasets

Pre-trained embeddings

Training

  • With random initialized embeddings: CUDA_VISIBLE_DEVICES=0 python trainer.py --max_neighbor 50 --fine_tune
  • With pretrained embeddings: CUDA_VISIBLE_DEVICES=0 python trainer.py --max_neighbor 50 --fine_tune --embed_model ComplEx

Visualization

tensorboard --logdir logs

Reference

@inproceedings{Xiong_Oneshot,
  author    = {Wenhan Xiong and
               Mo Yu and
               Shiyu Chang and
               Xiaoxiao Guo and
               William Yang Wang},
  title     = {One-Shot Relational Learning for Knowledge Graphs},
  booktitle = {Proceedings of the 2018 Conference on Empirical Methods in Natural
               Language Processing, Brussels, Belgium, October 31 - November 4, 2018},
  pages     = {1980--1990},
  publisher = {Association for Computational Linguistics},
  year      = {2018},
  url       = {https://aclanthology.info/papers/D18-1223/d18-1223},
  timestamp = {Sat, 27 Oct 2018 20:04:50 +0200},
}

one-shot-relational-learning's People

Contributors

xwhan 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.