Code Monkey home page Code Monkey logo

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tempoqr's Issues

About TempoQR result on TimeQuestions

Thank you so much for sharing the experimental results on TimeQuestions. It is super helpful for us! Right now we are conducting some experiments on TimeQuestions and need the full ranked answer list so that we could compute the metrics ourselves. I wonder if you could provide the ranked answer list of TimeQuestions? Thank you so much!

How did you get the entity/time embedding?

You mentioned in your paper that you used tkbc's paper method to get entity/time embedding,if I want use your method in other dataset,How can I get the perfect pretrain entity/time embedding? Is the model which get the best score?

Suggestion: TempoQR on TimeQuestions dataset

Hi, very interesting work!

I am one of the authors of the CronKGQA paper. Other than CronQuestions, I have been looking at other temporal KGQA datasets, one of which is TimeQuestions (https://exaqt.mpi-inf.mpg.de/). Since it is based on WikiData and not on a 'temporal KG', I processed the data provided by (https://github.com/zhenjia2017/EXAQT) using some heuristics to create a dataset somewhat similar in format to CronQuestions. You can find this processed dataset here: https://storage.googleapis.com/cronkgqa/timequestions.zip

I ran CronKGQA and TempoQR on TimeQuestions to the best of my abilities and got the following results:

image (3)

It would be great if you could also try out TempoQR on this dataset and see if you get different numbers. In my work, I am planning to report the numbers for TempoQR I obtained through my reproduction on TimeQuestions. If you think I am going wrong somewhere or you are able to get better results, I would be very happy to include those.

Thanks
Apoorv

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.