Skip to content

yongho94/solar-framework_commonsense-inference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solar-framework_commonsense-inference

Code release for "Learning from Missing Relations: Contrastive Learning with Commonsense Knowledge Graphs for Commonsense Inference"

Download Similarity Matrix :

gdown https://drive.google.com/uc?id=1EHMIZXP_T1UfSzCWv9Is16n8DRW3dGJx

Preprocessing

Download knowledge graphs

Commonsense Knowledge Graph Sources :

Simple preprocess

  • Download the above files, and preprocess each element in tab-separated tsv format.
# examples
subject1 \t relation1 \t object1
subject2 \t relation2 \t object2
...
  • Modify the preprocessed data path in config/{dataset}/dataset.yml
name: 'atomic'
truncate:
    subj_len: 25
    obj_len: 25
dir:
    train: {your path}
    dev: {your path}
    test: {your path}
sim: ## <- This is similarity matrix. you can download it from the above url.
    train: {your path}
    dev: {your path}

Fine-tuning

python scripts/finetune.py --dataset_type {dataset} --model_name {model_name} --model_size {model_size}

Pre-training

python scripts/feature_learn.py --dataset_type {dataset} --model_name {model_name} --model_size {model_size}

About

Code release for "Learning from Missing Relations: Contrastive Learning with Commonsense Knowledge Graphs for Commonsense Inference"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages