├── LICENSE ├── README.md ├── code ├── __init__.py ├── data_process │ ├── __init__.py │ └── dataset.py ├── models │ ├── __init__.py │ ├── distillation.py │ ├── knowformer.py │ ├── knowformer_encoder.py │ ├── nbert.py │ ├── nformer.py │ └── utils.py ├── trainer.py └── utils.py ├── dataset ├── fb15k-237 │ ├── dev.txt │ ├── support │ │ ├── entity.json │ │ └── relation.json │ ├── test.txt │ └── train.txt └── wn18rr │ ├── dev.txt │ ├── support │ ├── entity.json │ └── relation.json │ ├── test.txt │ └── train.txt ├── scripts ├── fb15k-237 │ ├── cole_train.sh │ ├── cole_validate.sh │ ├── nbert_pretrain.sh │ ├── nbert_train.sh │ ├── nbert_validate.sh │ ├── nformer_train.sh │ └── nformer_validate.sh └── wn18rr │ ├── cole_train.sh │ ├── cole_validate.sh │ ├── nbert_pretrain.sh │ ├── nbert_train.sh │ ├── nbert_validate.sh │ ├── nformer_train.sh │ └── nformer_validate.sh ├── train_cole.py ├── train_nbert.py ├── train_nformer.py └── utils.py /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/README.md -------------------------------------------------------------------------------- /code/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/__init__.py -------------------------------------------------------------------------------- /code/data_process/__init__.py: -------------------------------------------------------------------------------- 1 | from .dataset import KGCDataModule 2 | -------------------------------------------------------------------------------- /code/data_process/dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/data_process/dataset.py -------------------------------------------------------------------------------- /code/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/models/__init__.py -------------------------------------------------------------------------------- /code/models/distillation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/models/distillation.py -------------------------------------------------------------------------------- /code/models/knowformer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/models/knowformer.py -------------------------------------------------------------------------------- /code/models/knowformer_encoder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/models/knowformer_encoder.py -------------------------------------------------------------------------------- /code/models/nbert.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/models/nbert.py -------------------------------------------------------------------------------- /code/models/nformer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/models/nformer.py -------------------------------------------------------------------------------- /code/models/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/models/utils.py -------------------------------------------------------------------------------- /code/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/trainer.py -------------------------------------------------------------------------------- /code/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/code/utils.py -------------------------------------------------------------------------------- /dataset/fb15k-237/dev.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/fb15k-237/dev.txt -------------------------------------------------------------------------------- /dataset/fb15k-237/support/entity.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/fb15k-237/support/entity.json -------------------------------------------------------------------------------- /dataset/fb15k-237/support/relation.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/fb15k-237/support/relation.json -------------------------------------------------------------------------------- /dataset/fb15k-237/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/fb15k-237/test.txt -------------------------------------------------------------------------------- /dataset/fb15k-237/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/fb15k-237/train.txt -------------------------------------------------------------------------------- /dataset/wn18rr/dev.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/wn18rr/dev.txt -------------------------------------------------------------------------------- /dataset/wn18rr/support/entity.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/wn18rr/support/entity.json -------------------------------------------------------------------------------- /dataset/wn18rr/support/relation.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/wn18rr/support/relation.json -------------------------------------------------------------------------------- /dataset/wn18rr/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/wn18rr/test.txt -------------------------------------------------------------------------------- /dataset/wn18rr/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/dataset/wn18rr/train.txt -------------------------------------------------------------------------------- /scripts/fb15k-237/cole_train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/fb15k-237/cole_train.sh -------------------------------------------------------------------------------- /scripts/fb15k-237/cole_validate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/fb15k-237/cole_validate.sh -------------------------------------------------------------------------------- /scripts/fb15k-237/nbert_pretrain.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/fb15k-237/nbert_pretrain.sh -------------------------------------------------------------------------------- /scripts/fb15k-237/nbert_train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/fb15k-237/nbert_train.sh -------------------------------------------------------------------------------- /scripts/fb15k-237/nbert_validate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/fb15k-237/nbert_validate.sh -------------------------------------------------------------------------------- /scripts/fb15k-237/nformer_train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/fb15k-237/nformer_train.sh -------------------------------------------------------------------------------- /scripts/fb15k-237/nformer_validate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/fb15k-237/nformer_validate.sh -------------------------------------------------------------------------------- /scripts/wn18rr/cole_train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/wn18rr/cole_train.sh -------------------------------------------------------------------------------- /scripts/wn18rr/cole_validate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/wn18rr/cole_validate.sh -------------------------------------------------------------------------------- /scripts/wn18rr/nbert_pretrain.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/wn18rr/nbert_pretrain.sh -------------------------------------------------------------------------------- /scripts/wn18rr/nbert_train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/wn18rr/nbert_train.sh -------------------------------------------------------------------------------- /scripts/wn18rr/nbert_validate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/wn18rr/nbert_validate.sh -------------------------------------------------------------------------------- /scripts/wn18rr/nformer_train.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/wn18rr/nformer_train.sh -------------------------------------------------------------------------------- /scripts/wn18rr/nformer_validate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/scripts/wn18rr/nformer_validate.sh -------------------------------------------------------------------------------- /train_cole.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/train_cole.py -------------------------------------------------------------------------------- /train_nbert.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/train_nbert.py -------------------------------------------------------------------------------- /train_nformer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/train_nformer.py -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nju-websoft/CoLE/HEAD/utils.py --------------------------------------------------------------------------------