Giter Club home page Giter Club logo

cause's Introduction

CausE: Towards Causal Knowledge Graph Embedding

license AAAI Pytorch

Knowledge graph embedding (KGE) focuses on representing the entities and relations of a knowledge graph (KG) into the continuous vector spaces, which can be employed to predict the missing triples to achieve knowledge graph completion (KGC). However, KGE models often only briefly learn structural correlations of triple data and embeddings would be misled by the trivial patterns and noisy links in real-world KGs. To address this issue, we build the new paradigm of KGE in the context of causality and embedding disentanglement. We further propose a Causality-enhanced knowledge graph Embedding (CausE) framework. CausE employs causal intervention to estimate the causal effect of the confounder embeddings and design new training objectives to make stable predictions. Experimental results demonstrate that CausE could outperform the baseline models and achieve state-of-the-art KGC performance.

๐ŸŒˆ Model Architecture

Model_architecture

๐Ÿ“• Code Path

Code Structures

There are three parts in the code.

  • openke: It contains the main files for CausE.
  • benchmarks: It contains the data splits for different datasets.
  • script: The training scripts for CausE.

๐Ÿ”ฌ Dependencies

  • Python 3
  • PyTorch >= 1.8.0
  • NumPy
  • All experiments are performed with one RTX 3090Ti GPU.

๐Ÿ“š Prerequisites

  • Dataset: The baseline datasets FB15K-237 and WN18RR have been prepared in the benchmarks/, you can also upload your own KG datasets in the same form.
  • Environment: Our code is based on the open-source project OpenKE, you need to following up the instruction in the OpenKE to build the running environment.

๐Ÿš€ Train & Eval

The training script for CausE:

bash script/run_cause_transe.sh # TransE score function
bash script/run_cause_distmult.sh # DistMult score function
bash script/run_cause_complex.sh # ComplEx score function

The default hyper-parameters are set in the scripts. You can carefully tune these parameters

๐Ÿค Cite:

Please condiser citing this paper if you use the code from our work. Thanks a lot :)

@misc{zhang2023cause,
      title={CausE: Towards Causal Knowledge Graph Embedding}, 
      author={Yichi Zhang and Wen Zhang},
      year={2023},
      eprint={2307.11610},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

cause's People

Contributors

zhang-each avatar wencolani 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.