Model Specification¶
Meta Generation¶
Generate model meta.
Usage:
usage: meta.py [-h] -c CORPUS -m MODEL [--emb EMB] [-k] Generate CosmEL meta data. optional arguments: -h, --help show this help message and exit -c CORPUS, --corpus CORPUS store corpus data in directory "<CORPUS>/" -m MODEL, --model MODEL store model data in directory "<MODEL>/" --emb EMB embedding path; default is "<CORPUS>/embeddings/purged_article.dim300.emb.bin" -k, --check check arguments
Model Training¶
Training model.
Usage:
usage: train.py [-h] -c CORPUS -m MODEL [-i INPUT] -l {gid,nid,rid} -s STRUCTURE [-w WEIGHT] [-p PRETRAIN] [--epoch EPOCH] [--test_size TEST_SIZE] [-k] Train CosmEL model. optional arguments: -h, --help show this help message and exit -c CORPUS, --corpus CORPUS store corpus data in directory "<CORPUS>/" -m MODEL, --model MODEL store model data in directory "<MODEL>/" -i INPUT, --input INPUT load mention from "<CORPUS>/mention/<IN-DIR>/"; default is "purged_article_grid" -l {gid,nid,rid}, --label {gid,nid,rid} training label type -s STRUCTURE, --structure STRUCTURE model structure -w WEIGHT, --weight WEIGHT output weight name; output model weight into "<MODEL>/<WEIGHT>.<STRUCTURE>.weight.pt"; default "[<PRETRAIN>+]<LABEL>" -p PRETRAIN, --pretrain PRETRAIN pretrained weight name; load model weight from "<MODEL>/<PRETRAIN>.<STRUCTURE>.weight.pt" --epoch EPOCH train <EPOCH> times; default is 10 --test_size TEST_SIZE split <TEST-SIZE> mentions for testing; default is 0.3 -k, --check Check arguments
Model Predicting¶
Predicting label using model.
Usage:
usage: predict.py [-h] -c CORPUS -m MODEL [-i INPUT] [-o OUTPUT] [-s STRUCTURE_EEM] [-S STRUCTURE_MTC] [-l LABEL_EEM] [-L LABEL_MTC] [-k] Apply CosmEL model. optional arguments: -h, --help show this help message and exit -c CORPUS, --corpus CORPUS store corpus data in directory "<CORPUS>/" -m MODEL, --model MODEL store model data in directory "<MODEL>/"; default is "<CORPUS>/model/" -i INPUT, --input INPUT load mention from "<CORPUS>/mention/<INPUT>/"; default is "purged_article_rid" -o OUTPUT, --output OUTPUT save mention into "<CORPUS>/mention/<OUTPUT>/"; default is "purged_article_nrid" -s STRUCTURE_EEM, --structure-eem STRUCTURE_EEM use model structure <STRUCTURE-EEM> for entity embeddings model -S STRUCTURE_MTC, --structure-mtc STRUCTURE_MTC use model structure <STRUCTURE-MTC> for mention type classifier -l LABEL_EEM, --label-eem LABEL_EEM use label type <LABEL-EEM> for entity embeddings model -L LABEL_MTC, --label-mtc LABEL_MTC use label type <LABEL-MTC> for mention type classifier -k, --check Check arguments