Home

Awesome

<div align="center"> <img src="https://github.com/zjukg/MEAformer/blob/main/IMG/MEAformer7.png" alt="Logo" width="400"> </div>

πŸ–οΈ MEAformer: Multi-modal Entity Alignment Transformer for Meta Modality Hybrid

license arxiv badge Pytorch ACMMM

This paper introduces MEAformer, a multi-modal entity alignment transformer approach for meta modality hybrid, which dynamically predicts the mutual correlation coefficients among modalities for more fine-grained entity-level modality fusion and alignment.

<!--<div align="center"> <img src="https://github.com/zjukg/MEAformer/blob/main/IMG/MEAformer.jpg" width="95%" height="auto" /> </div> -->

MEAformer

<p align="center"><i><b>πŸ‘† Click to see the Video</b></i></p>

πŸ”” News

<!-- >In this paper .... -->

πŸ”¬ Dependencies

pip install -r requirement.txt

Details

πŸš€ Train

>> cd MEAformer
>> bash run.sh
>> cd MEAformer
# -----------------------
# ---- non-iterative ----
# -----------------------
# ----  w/o surface  ---- 
# FBDB15K
>> bash run_meaformer.sh 1 FBDB15K norm 0.8 0 
>> bash run_meaformer.sh 1 FBDB15K norm 0.5 0 
>> bash run_meaformer.sh 1 FBDB15K norm 0.2 0 
# FBYG15K
>> bash run_meaformer.sh 1 FBYG15K norm 0.8 0 
>> bash run_meaformer.sh 1 FBYG15K norm 0.5 0 
>> bash run_meaformer.sh 1 FBYG15K norm 0.2 0 
# DBP15K
>> bash run_meaformer.sh 1 DBP15K zh_en 0.3 0 
>> bash run_meaformer.sh 1 DBP15K ja_en 0.3 0 
>> bash run_meaformer.sh 1 DBP15K fr_en 0.3 0
# ----  w/ surface  ---- 
# DBP15K
>> bash run_meaformer.sh 1 DBP15K zh_en 0.3 1 
>> bash run_meaformer.sh 1 DBP15K ja_en 0.3 1 
>> bash run_meaformer.sh 1 DBP15K fr_en 0.3 1
# -----------------------
# ------ iterative ------
# -----------------------
# ----  w/o surface  ---- 
# FBDB15K
>> bash run_meaformer_il.sh 1 FBDB15K norm 0.8 0 
>> bash run_meaformer_il.sh 1 FBDB15K norm 0.5 0 
>> bash run_meaformer_il.sh 1 FBDB15K norm 0.2 0 
# FBYG15K
>> bash run_meaformer_il.sh 1 FBYG15K norm 0.8 0 
>> bash run_meaformer_il.sh 1 FBYG15K norm 0.5 0 
>> bash run_meaformer_il.sh 1 FBYG15K norm 0.2 0 
# DBP15K
>> bash run_meaformer_il.sh 1 DBP15K zh_en 0.3 0 
>> bash run_meaformer_il.sh 1 DBP15K ja_en 0.3 0 
>> bash run_meaformer_il.sh 1 DBP15K fr_en 0.3 0
# ----  w/ surface  ---- 
# DBP15K
>> bash run_meaformer_il.sh 1 DBP15K zh_en 0.3 1 
>> bash run_meaformer_il.sh 1 DBP15K ja_en 0.3 1 
>> bash run_meaformer_il.sh 1 DBP15K fr_en 0.3 1

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

🎯 Results

$\bf{H@1}$ Performance with the Settings: w/o surface & Non-iterative in UMAEA. We modified part of the MSNEA to involve not using the content of attribute values but only the attribute types themselves (See issues for details):

Method$\bf{DBP15K_{ZH-EN}}$$\bf{DBP15K_{JA-EN}}$$\bf{DBP15K_{FR-EN}}$
MSNEA.609.541.557
EVA.683.669.686
MCLEA.726.719.719
MEAformer.772.764.771
UMAEA.800.801.818

πŸ“š Dataset

ROOT
β”œβ”€β”€ data
β”‚Β Β  └── mmkg
└── code
 Β Β  └── MEAformer
import pickle
zh_images = pickle.load(open("eva_image_resources/dbp15k/zh_dbp15k_link_img_dict_full.pkl",'rb'))
print(en_images["http://zh.dbpedia.org/resource/ι¦™ζΈ―ζœ‰η·šι›»θ¦–"].size)

Code Path

<details> <summary>πŸ‘ˆ πŸ”Ž Click</summary>
MEAformer
β”œβ”€β”€ config.py
β”œβ”€β”€ main.py
β”œβ”€β”€ requirement.txt
β”œβ”€β”€ run_meaformer.sh
β”œβ”€β”€ run_meaformer_il.sh
β”œβ”€β”€ run.sh
β”œβ”€β”€ model
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ layers.py
β”‚   β”œβ”€β”€ MEAformer_loss.py
β”‚   β”œβ”€β”€ MEAformer.py
β”‚   β”œβ”€β”€ MEAformer_tools.py
β”‚   └── Tool_model.py
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ distributed_utils.py
β”‚   β”œβ”€β”€ data.py
β”‚   └── utils.py
└── torchlight
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ logger.py
    β”œβ”€β”€ metric.py
    └── utils.py
</details>

Data Path

<details> <summary>πŸ‘ˆ πŸ”Ž Click</summary>
mmkg
β”œβ”€β”€ DBP15K
β”‚Β Β  β”œβ”€β”€ fr_en
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ent_ids_1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ent_ids_2
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ill_ent_ids
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ training_attrs_1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ training_attrs_2
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ triples_1
β”‚Β Β  β”‚Β Β  └── triples_2
β”‚Β Β  β”œβ”€β”€ ja_en
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ent_ids_1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ent_ids_2
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ill_ent_ids
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ training_attrs_1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ training_attrs_2
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ triples_1
β”‚Β Β  β”‚Β Β  └── triples_2
β”‚Β Β  β”œβ”€β”€ translated_ent_name
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ dbp_fr_en.json
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ dbp_ja_en.json
β”‚Β Β  β”‚Β Β  └── dbp_zh_en.json
β”‚Β Β  └── zh_en
β”‚Β Β      β”œβ”€β”€ ent_ids_1
β”‚Β Β      β”œβ”€β”€ ent_ids_2
β”‚Β Β      β”œβ”€β”€ ill_ent_ids
β”‚Β Β      β”œβ”€β”€ training_attrs_1
β”‚Β Β      β”œβ”€β”€ training_attrs_2
β”‚Β Β      β”œβ”€β”€ triples_1
β”‚Β Β      └── triples_2
β”œβ”€β”€ FBDB15K
β”‚Β Β  └── norm
β”‚Β Β      β”œβ”€β”€ ent_ids_1
β”‚Β Β      β”œβ”€β”€ ent_ids_2
β”‚Β Β      β”œβ”€β”€ ill_ent_ids
β”‚Β Β      β”œβ”€β”€ training_attrs_1
β”‚Β Β      β”œβ”€β”€ training_attrs_2
β”‚Β Β      β”œβ”€β”€ triples_1
β”‚Β Β      └── triples_2
β”œβ”€β”€ FBYG15K
β”‚Β Β  └── norm
β”‚Β Β      β”œβ”€β”€ ent_ids_1
β”‚Β Β      β”œβ”€β”€ ent_ids_2
β”‚Β Β      β”œβ”€β”€ ill_ent_ids
β”‚Β Β      β”œβ”€β”€ training_attrs_1
β”‚Β Β      β”œβ”€β”€ training_attrs_2
β”‚Β Β      β”œβ”€β”€ triples_1
β”‚Β Β      └── triples_2
β”œβ”€β”€ embedding
β”‚Β Β  └── glove.6B.300d.txt
β”œβ”€β”€ pkls
β”‚Β Β  β”œβ”€β”€ dbpedia_wikidata_15k_dense_GA_id_img_feature_dict.pkl
β”‚Β Β  β”œβ”€β”€ dbpedia_wikidata_15k_norm_GA_id_img_feature_dict.pkl
β”‚Β Β  β”œβ”€β”€ FBDB15K_id_img_feature_dict.pkl
β”‚Β Β  β”œβ”€β”€ FBYG15K_id_img_feature_dict.pkl
β”‚Β Β  β”œβ”€β”€ fr_en_GA_id_img_feature_dict.pkl
β”‚Β Β  β”œβ”€β”€ ja_en_GA_id_img_feature_dict.pkl
β”‚Β Β  └── zh_en_GA_id_img_feature_dict.pkl
β”œβ”€β”€ MEAformer
└── dump
</details>

🀝 Cite:

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

@inproceedings{DBLP:conf/mm/ChenCZGFHZGPSC23,
  author       = {Zhuo Chen and
                  Jiaoyan Chen and
                  Wen Zhang and
                  Lingbing Guo and
                  Yin Fang and
                  Yufeng Huang and
                  Yichi Zhang and
                  Yuxia Geng and
                  Jeff Z. Pan and
                  Wenting Song and
                  Huajun Chen},
  title        = {MEAformer: Multi-modal Entity Alignment Transformer for Meta Modality
                  Hybrid},
  booktitle    = {{ACM} Multimedia},
  pages        = {3317--3327},
  publisher    = {{ACM}},
  year         = {2023}
}

πŸ’‘ Acknowledgement

We appreciate MCLEA, MSNEA, EVA, MMEA and many other related works for their open-source contributions.

<a href="https://info.flagcounter.com/VOlE"><img src="https://s11.flagcounter.com/count2/VOlE/bg_FFFFFF/txt_000000/border_F7F7F7/columns_6/maxflags_12/viewers_3/labels_0/pageviews_0/flags_0/percent_0/" alt="Flag Counter" border="0"></a>