GithubHelp home page GithubHelp logo

hell-to-heaven / tempoqr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmavro/tempoqr

0.0 1.0 0.0 41 KB

[AAAI 2022] TempoQR: Temporal Question Reasoning over Knowledge Graphs

Python 100.00%

tempoqr's Introduction

TempoQR

This is the code for the manuscript "TempoQR: Temporal Question Reasoning over Knowledge Graphs" (AAAI2022). Paper: https://arxiv.org/abs/2112.05785

PWC

image

Installation

Clone and create a conda environment

git clone https://github.com/cmavro/TempoQR.git
cd TempoQR
conda create --prefix ./tempoqr_env python=3.7
conda activate ./tempoqr_env

The implementation is based on CronKGQA in Question Answering over Temporal Knowledge Graphs and their code from https://github.com/apoorvumang/CronKGQA. You can find more installation details there. We use TComplEx KG Embeddings as implemented in https://github.com/facebookresearch/tkbc.

Install TempoQR requirements

conda install --file requirements.txt -c conda-forge

Dataset and pretrained models download

Download and unzip data.zip and models.zip in the root directory.

Drive: https://drive.google.com/drive/folders/1aS2s5sZ0qlDpGZ9rdR7HcHym23N3pUea?usp=sharing.

Running the code

TempoQR:

python ./train_qa_model.py --model tempoqr --supervision soft
python ./train_qa_model.py --model tempoqr --supervision hard

Other models: "entityqr" and "cronkgqa" with hard and soft supervisions.

To use a corrupted TKG change to "--tkg_file train_corXX.txt" and "--tkbc_model_file tcomplex_corXX.ckpt", where XX=20,33,50.

To evaluate on unseen complex questions change to "--test test_bef_and_aft" or "--test test_fir_las_bef_aft".

Please explore more argument options in train_qa_model.py.

Minor Note: Not all modules have been tested after the code merging.

Cite

If you find our method, code, or experimental setups useful, please cite our paper:

@misc{mavromatis2021tempoqr,
      title={TempoQR: Temporal Question Reasoning over Knowledge Graphs}, 
      author={Costas Mavromatis and Prasanna Lakkur Subramanyam and Vassilis N. Ioannidis and Soji Adeshina and Phillip R. Howard and Tetiana Grinberg and Nagib Hakim and George Karypis},
      year={2021},
      eprint={2112.05785},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

tempoqr's People

Contributors

cmavro avatar

Watchers

James Cloos 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.