├── .gitattributes ├── .gitignore ├── CONSTANTS.py ├── LICENSE ├── README.md ├── data ├── CN82K │ ├── embeddings │ │ ├── bert-base-uncased-ft_mean.pt │ │ ├── bert-base-uncased-ft_mean_flow.pt │ │ ├── bert-base-uncased_prior.pt │ │ └── bert-base-uncased_prior_flow.pt │ ├── entity_idx.json │ ├── entity_names.json │ ├── entity_names.txt │ ├── rel_idx.json │ ├── test.txt │ ├── train.txt │ └── valid.txt ├── FB15K-237 │ ├── embeddings │ │ ├── bert-base-uncased-ft_mean.pt │ │ ├── bert-base-uncased-ft_mean_flow.pt │ │ ├── bert-base-uncased_prior.pt │ │ └── bert-base-uncased_prior_flow.pt │ ├── entity_idx.json │ ├── entity_names.json │ ├── entity_names.txt │ ├── rel_idx.json │ ├── test.txt │ ├── train.txt │ └── valid.txt └── WN18RR │ ├── embeddings │ ├── bert-base-uncased-ft_mean.pt │ └── bert-base-uncased-ft_mean_flow.pt │ ├── entity_idx.json │ ├── entity_names.json │ ├── entity_names.txt │ ├── rel_idx.json │ ├── test.txt │ ├── train.txt │ └── valid.txt ├── dataset.py ├── evaluation.py ├── flow ├── CONSTANTS.py ├── dataset.py ├── flow.py ├── loss.py ├── scripts │ └── cn82k_flow.sh ├── train.py └── util.py ├── models.py ├── preprocessing └── process_datasets.py ├── requirements.txt ├── scripts ├── head_ent_extraction │ ├── cn82k_probe.sh │ └── cn82k_prompt.sh └── tail_emb_processing │ ├── cn82k_flow.sh │ └── cn82k_res_mlp.sh ├── train.py └── utils.py /.gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/.gitattributes -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/.gitignore -------------------------------------------------------------------------------- /CONSTANTS.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/CONSTANTS.py -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/README.md -------------------------------------------------------------------------------- /data/CN82K/embeddings/bert-base-uncased-ft_mean.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/embeddings/bert-base-uncased-ft_mean.pt -------------------------------------------------------------------------------- /data/CN82K/embeddings/bert-base-uncased-ft_mean_flow.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/embeddings/bert-base-uncased-ft_mean_flow.pt -------------------------------------------------------------------------------- /data/CN82K/embeddings/bert-base-uncased_prior.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/embeddings/bert-base-uncased_prior.pt -------------------------------------------------------------------------------- /data/CN82K/embeddings/bert-base-uncased_prior_flow.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/embeddings/bert-base-uncased_prior_flow.pt -------------------------------------------------------------------------------- /data/CN82K/entity_idx.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/entity_idx.json -------------------------------------------------------------------------------- /data/CN82K/entity_names.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/entity_names.json -------------------------------------------------------------------------------- /data/CN82K/entity_names.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/entity_names.txt -------------------------------------------------------------------------------- /data/CN82K/rel_idx.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/rel_idx.json -------------------------------------------------------------------------------- /data/CN82K/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/test.txt -------------------------------------------------------------------------------- /data/CN82K/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/train.txt -------------------------------------------------------------------------------- /data/CN82K/valid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/CN82K/valid.txt -------------------------------------------------------------------------------- /data/FB15K-237/embeddings/bert-base-uncased-ft_mean.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/embeddings/bert-base-uncased-ft_mean.pt -------------------------------------------------------------------------------- /data/FB15K-237/embeddings/bert-base-uncased-ft_mean_flow.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/embeddings/bert-base-uncased-ft_mean_flow.pt -------------------------------------------------------------------------------- /data/FB15K-237/embeddings/bert-base-uncased_prior.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/embeddings/bert-base-uncased_prior.pt -------------------------------------------------------------------------------- /data/FB15K-237/embeddings/bert-base-uncased_prior_flow.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/embeddings/bert-base-uncased_prior_flow.pt -------------------------------------------------------------------------------- /data/FB15K-237/entity_idx.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/entity_idx.json -------------------------------------------------------------------------------- /data/FB15K-237/entity_names.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/entity_names.json -------------------------------------------------------------------------------- /data/FB15K-237/entity_names.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/entity_names.txt -------------------------------------------------------------------------------- /data/FB15K-237/rel_idx.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/rel_idx.json -------------------------------------------------------------------------------- /data/FB15K-237/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/test.txt -------------------------------------------------------------------------------- /data/FB15K-237/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/train.txt -------------------------------------------------------------------------------- /data/FB15K-237/valid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/FB15K-237/valid.txt -------------------------------------------------------------------------------- /data/WN18RR/embeddings/bert-base-uncased-ft_mean.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/embeddings/bert-base-uncased-ft_mean.pt -------------------------------------------------------------------------------- /data/WN18RR/embeddings/bert-base-uncased-ft_mean_flow.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/embeddings/bert-base-uncased-ft_mean_flow.pt -------------------------------------------------------------------------------- /data/WN18RR/entity_idx.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/entity_idx.json -------------------------------------------------------------------------------- /data/WN18RR/entity_names.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/entity_names.json -------------------------------------------------------------------------------- /data/WN18RR/entity_names.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/entity_names.txt -------------------------------------------------------------------------------- /data/WN18RR/rel_idx.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/rel_idx.json -------------------------------------------------------------------------------- /data/WN18RR/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/test.txt -------------------------------------------------------------------------------- /data/WN18RR/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/train.txt -------------------------------------------------------------------------------- /data/WN18RR/valid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/data/WN18RR/valid.txt -------------------------------------------------------------------------------- /dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/dataset.py -------------------------------------------------------------------------------- /evaluation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/evaluation.py -------------------------------------------------------------------------------- /flow/CONSTANTS.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/flow/CONSTANTS.py -------------------------------------------------------------------------------- /flow/dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/flow/dataset.py -------------------------------------------------------------------------------- /flow/flow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/flow/flow.py -------------------------------------------------------------------------------- /flow/loss.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/flow/loss.py -------------------------------------------------------------------------------- /flow/scripts/cn82k_flow.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/flow/scripts/cn82k_flow.sh -------------------------------------------------------------------------------- /flow/train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/flow/train.py -------------------------------------------------------------------------------- /flow/util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/flow/util.py -------------------------------------------------------------------------------- /models.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/models.py -------------------------------------------------------------------------------- /preprocessing/process_datasets.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/preprocessing/process_datasets.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/requirements.txt -------------------------------------------------------------------------------- /scripts/head_ent_extraction/cn82k_probe.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/scripts/head_ent_extraction/cn82k_probe.sh -------------------------------------------------------------------------------- /scripts/head_ent_extraction/cn82k_prompt.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/scripts/head_ent_extraction/cn82k_prompt.sh -------------------------------------------------------------------------------- /scripts/tail_emb_processing/cn82k_flow.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/scripts/tail_emb_processing/cn82k_flow.sh -------------------------------------------------------------------------------- /scripts/tail_emb_processing/cn82k_res_mlp.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/scripts/tail_emb_processing/cn82k_res_mlp.sh -------------------------------------------------------------------------------- /train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/train.py -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinlovelace/LM-KG-Completion/HEAD/utils.py --------------------------------------------------------------------------------