Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b693ce6
commit 48bdac9
Showing
6 changed files
with
144 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### Example Usage | ||
|
||
KBP | ||
|
||
``` | ||
CoType/retype-rm -data KBP -mode m -size 50 -negative 3 -threads 3 -alpha 0.0001 -samples 1 -iters 2000 -lr 0.001 | ||
python2 CoType/Evaluation/emb_dev_n_test.py extract KBP retypeRm cosine 0.0 | ||
``` | ||
NYT | ||
``` | ||
CoType/retype-rm -data NYT -mode m -size 50 -negative 3 -threads 3 -alpha 0.0001 -samples 1 -iters 1000 -lr 0.01 | ||
python2 CoType/Evaluation/emb_dev_n_test.py extract NYT retypeRm cosine 0.0 | ||
``` | ||
|
||
TACRED | ||
``` | ||
CoType/retype-rm -data TACRED -mode m -size 50 -negative 3 -threads 3 -alpha 0.0001 -samples 1 -iters 1000 -lr 0.01 | ||
python2 CoType/Evaluation/emb_dev_n_test.py extract TACRED retypeRm cosine 0.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
### Example Usage | ||
|
||
First, move to the model directory with `cd LogisticRegression` | ||
|
||
KBP (Using default args) | ||
``` | ||
python2 train.py | ||
python2 test.py | ||
``` | ||
|
||
NYT | ||
``` | ||
python2 train.py --save_filename result_nyt.pkl --data_dir ../data/intermediate/NYT/rm | ||
python2 test.py --save_filename result_nyt.pkl --data_dir ../data/intermediate/NYT/rm | ||
``` | ||
|
||
TACRED | ||
``` | ||
python2 train.py --save_filename result_tacred.pkl --data_dir ../data/intermediate/TACRED/rm | ||
python2 test.py --save_filename result_tacred.pkl --data_dir ../data/intermediate/TACRED/rm | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
### Arguments | ||
|
||
You can select dataset, set hyperparameters, choose the way to handle bias term by passing arguments. For simplicity, we're only listing some important arguments here. Check the usage of all available arguments with `python Neural/train.py -h` and `python Neural/test.py -h` | ||
|
||
``` | ||
train.py | ||
--data_dir DATA_DIR specify dataset with directory. | ||
--model MODEL model name, (cnn|pcnn|bgru|lstm). | ||
--fix_bias Train model with fix bias (not fixed by default). | ||
--repeat REPEAT train the model for multiple times. | ||
--info INFO description, also used as filename to save model. | ||
``` | ||
``` | ||
test.py | ||
--info INFO description, also used as filename to save model. | ||
--repeat REPEAT test the model for multiple trains. | ||
--thres_ratio THRES_RATIO | ||
proportion of data to tune thres. | ||
--bias_ratio BIAS_RATIO | ||
proportion of data to estimate bias. | ||
--cvnum CVNUM # samples to tune thres or estimate bias | ||
--fix_bias test model with fix bias (not fixed by default). | ||
``` | ||
|
||
### Example Usage | ||
|
||
KBP (Using default args) | ||
``` | ||
python Neural/train.py --repeat 1 | ||
python Neural/eva.py --repeat 1 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### Example Usage | ||
|
||
KBP (Using default args) | ||
``` | ||
python Neural/train.py --repeat 1 | ||
python Neural/eva.py --repeat 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
### Arguments | ||
You can select dataset, set hyperparameters, choose the way to handle bias term by passing arguments. For simplicity, we're only listing some important arguments here. Check the usage of all available arguments with `python ReHession/run.py -h` and `python ReHession/eva.py -h` | ||
|
||
``` | ||
run.py | ||
--dataset DATASET name of the dataset, (KBP|NYT|TACRED). | ||
--bias BIAS ways to handle bias term, (default|fix). | ||
--info INFO description, also used as filename to save model. | ||
``` | ||
|
||
``` | ||
eva.py | ||
--dataset DATASET name of the dataset, (KBP|NYT|TACRED). | ||
--bias BIAS ways to handle bias term, (default|fix|set) | ||
--info INFO description, also used as filename to load model. | ||
--thres_ratio THRES_RATIO | ||
proportion of data to tune thres. | ||
--bias_ratio BIAS_RATIO | ||
proportion of data to estimate bias. | ||
``` | ||
|
||
By default, `eva.py` evaluates the performance (1) without threshold, (2) with max threshold, (3) with entropy threshold. Set `--bias set` to enable "Set Bias" during evaluation. If you train a model with `--bias fix`, you should pass the same flag to eva.py. | ||
|
||
|
||
### Example Usage | ||
KBP (Using default args) | ||
``` | ||
python ReHession/run.py --seed 1 | ||
python ReHession/eva.py --seed 1 | ||
``` | ||
|
||
|
||
NYT | ||
``` | ||
python ReHession/run.py --dataset NYT --info NYT-default --input_dropout 0.5 --output_dropout 0.0 --seed 1 | ||
python ReHession/eva.py --info NYT-default | ||
``` | ||
|
||
|
||
TACRED | ||
``` | ||
python ReHession/run.py --dataset TACRED --info TACRED-default --input_dropout 0.2 --output_dropout 0.1 --seed 2 | ||
python ReHession/eva.py --info TACRED-default | ||
``` |