Giter VIP home page Giter VIP logo

hyte's Introduction

HyTE

HyTE: Hyperplane-based Temporally aware Knowledge Graph Embedding

Source code and dataset for EMNLP 2018 paper: HyTE: Hyperplane-based Temporally aware Knowledge Graph Embedding.

Overview of HyTE (proposed method). a temporally aware KG embedding method which explicitly incorporates time in the entity-relation space by stitching each timestamp with a corresponding hyperplane. HyTE not only performs KG inference using temporal guidance, but also predicts temporal scopes for relational facts with missing time annotations. Please refer paper for more details.

Dependencies

  • Compatible with TensorFlow 1.x and Python 3.x.
  • Dependencies can be installed using requirements.txt.

Dataset:

  • Download the processed version of WikiData and YAGO datasets.
  • Unzip the .zip file in data directory.
  • Documents are originally taken from YAGO and Wikidata.

Usage:

  • After installing python dependencies from requirements.txt, execute sh setup.sh for downloading GloVe embeddings.

  • time_proj.py contains TensorFlow (1.x) based implementation of HyTE (proposed method).

  • To start training:

    python time_proj.py -data data/processed_data.pkl -class 10 -name MODEL_NAME -test_freq 25 -<other_optins> ...
  • Some of the important Available options include:

  '-data_type' default ='yago', choices = ['yago','wiki_data'], help ='dataset to choose'
  '-version',  default = 'large', choices = ['large','small'], help = 'data version to choose'
  '-test_freq', 	 default = 25,   	type=int, 	help='testing frequency'
  '-neg_sample', 	 default = 5,   	type=int, 	help='negative samples for training'
  '-gpu', 	 dest="gpu", 		default='1',			help='GPU to use'
  '-name', 	 dest="name", 		help='Name of the run'
  '-lr',	 dest="lr", 		default=0.0001,  type=float,	help='Learning rate'
  '-margin', 	 dest="margin", 	default=1,   	type=float, 	help='margin'
  '-batch', 	 dest="batch_size", 	default= 50000,   	type=int, 	help='Batch size'
  '-epoch', 	 dest="max_epochs", 	default= 5000,   	type=int, 	help='Max epochs'
  '-l2', 	 dest="l2", 		default=0.0, 	type=float, 	help='L2 regularization'
  '-seed', 	 dest="seed", 		default=1234, 	type=int, 	help='Seed for randomization'
  '-inp_dim',  dest="inp_dim", 	default = 128,   	type=int, 	help='')
  '-L1_flag',  dest="L1_flag", 	action='store_false',   	 	help='Hidden state dimension of FC layer'

Evaluation:

  • After trainig start validation/test. Use the same model name and test frequency used at training as arguments for the following evalutation--
  • For getting MR and hit@10 for head and tail prediction:
   python result_eval.py -model MODEL_NAME  -test_freq 25
  • For getting MR and hit@10 for relation prediction:
   python result_eval_relation.py -model MODEL_NAME  -test_freq 25

Citing:

@InProceedings{
}

hyte's People

Contributors

ssdasgupta avatar parthatalukdar 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.