GithubHelp home page GithubHelp logo

zjukg / snag Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 1.0 921 KB

[Paper][Preprint 2024] The Power of Noise: Toward a Unified Multi-modal Knowledge Graph Representation Framework

Home Page: https://arxiv.org/abs/2403.06832

License: MIT License

Python 95.63% Shell 4.37%
entity-alignment graph knowledge-graph knowledge-graph-completion knowledge-graph-representation link link-prediction missing-modality mmkg multi-modal-knowledge-graph

snag's Introduction

SNAG

license arxiv badge Pytorch

In this work, we introduce a Unified Multi-Modal Knowledge Graph (MMKG) Representation Framework that incorporates tailored training objectives for Multi-modal Knowledge Graph Completion (MKGC) and Multi-modal Entity Alignment (MMEA). Our approach achieves SOTA performance across a comprehensive suite of ten datasets, including three for MKGC and seven for MMEA, demonstrating the framework's effectiveness and versatility in diverse multi-modal contexts.

πŸ”” News

πŸ”¬ Dependencies

pip install -r requirement.txt

Details

  • Python (>= 3.7)
  • PyTorch (>= 1.6.0)
  • numpy (>= 1.19.2)
  • Transformers (== 4.21.3)
  • easydict (>= 1.10)
  • unidecode (>= 1.3.6)
  • tensorboard (>= 2.11.0)

πŸš€ MKGC Train

  • Quick start: Using script file (run.sh)
>> cd SNAG_MKGC
>> bash run.sh
  • Optional: Using the bash command:
# Command Details:
#  GPU | DATA | num_proj | use_intermediate | joint_way | noise ratio | mask ratio | noise-level | num_hidden_layers | num_attention_heads | Exp ID

# # DATA=DB15K / MKG-W / MKG-Y
# num_proj: 1 / 2
# use_intermediate: 0 / 1
# joint_way: "Mformer_hd_mean" / "Mformer_hd_graph" / "Mformer_weight" / "atten_weight" / "learnable_weight"
# noise ratio: 0 ~ 1
# mask ratio: 0 ~ 1
# noise-level: epoch / step

>> bash scripts/run_base.sh 0 DB15K 2 0 Mformer_hd_graph 0.2 0.7 epoch 1 2 K001
>> bash scripts/run_base.sh 0 MKG-Y 1 0 Mformer_hd_mean 0.2 0.7 epoch 1 2 Y001
>> bash scripts/run_base.sh 0 MKG-W 1 0 Mformer_hd_mean 0.2 0.7 epoch 1 2 W001

❗Tips: you can open the run.sh file for parameter or training target modification.

  • Optional: Modifying the basic parameters:
    • you can open the scripts/run_base.sh file for parameter or training target modification
      • Make NOISE = 0 to abandon the gauss modality noise masking.
      • EPOCH can be set to 8000 as early stopping is employed by default.
      • The noise_level or noise_update parameter determines whether the Noise mask is updated at every step or every epoch. Through experimentation, we have found that updating at the epoch level is sufficient.
      • The use_pool flag indicates that pooling operations are applied to all pre-extracted visual/text features for dimensionality reduction and uniformity in dimensions.
EMB_DIM=128
NUM_BATCH=1024
MARGIN=12
LR=1e-4
LRG=1e-4
NEG_NUM=32
EPOCH=8000
NOISE=1
POOL=1

πŸš€ MMEA Train

  • Quick start: Using script file (run.sh)
>> cd SNAG_MMEA
>> bash run.sh 0
  • Optional: Using the bash command
# Command Details:
# bash file | GPU | Dataset | data split | R_{sa} | random seed | use_surface | R_{img} | noise ratio | mask ratio |
# Begin:
>> bash run_snag.sh 0 DBP15K ja_en 0.3 3408 0 1.0 0.2 0.7
>> bash run_snag.sh 0 DBP15K ja_en 0.3 3408 0 0.6 0.2 0.7
>> bash run_snag.sh 0 DBP15K ja_en 0.3 3408 0 0.4 0.2 0.7

❗Tips: you can open the run_XXX.sh file for parameter or training target modification.

πŸ“š Dataset

❗MMEA: From UMAEA Repo

❗MKGC: Download from Here

🀝 Cite:

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

@article{chen2024power,
  title={The Power of Noise: Toward a Unified Multi-modal Knowledge Graph Representation Framework},
  author={Chen, Zhuo and Fang, Yin and Zhang, Yichi and Guo, Lingbing and Chen, Jiaoyan and Chen, Huajun and Zhang, Wen},
  journal={arXiv preprint arXiv:2403.06832},
  year={2024}
}

snag's People

Contributors

hackerchenzhuo avatar wencolani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fajunchen

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.