Step1. Install PyTorch following this link: https://pytorch.org/get-started/locally/
Examples:
# gpu version
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
# cpu version
pip install torch==1.8.0+cpu torchvision==0.9.0+cpu torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
######
Step2. Install all requirements
pip install -r requirements.txt
- cd to the folder scripts
python train_and_eval_t5-large-TLS-1.py
python tokens_pruning_mturk.py --n-trials=50 --lang=en --phase=valid --model-name=None
python tokens_pruning_nnseval.py --n-trials=50 --lang=en --phase=valid --model-name=None
python tokens_pruning_benchls.py --n-trials=50 --lang=en --phase=valid --model-name=None
#E.g., --model-name=exp_1679326129880862 to load exp_1679326129880862 model
-
First, update the
evaluate-TLS-1.py
file, and set themodel_dir=None
means that the script will load the latest model or set a model folder to load the specific one likemodel_dir=exp_1679619309663310
to loadexp_1679619309663310
model. -
Update the
features_kwargs
to the best set from the tokens search -
And run the following script to evaluate
python evaluate-TLS-1.py
# Train
python train_and_eval_t5-large-TLS-2.py
python tokens_pruning.py --n-trials=150 --lang=en --phase=valid --model-name=None
#E.g., --model-name=exp_1679326129880862 to load exp_1679326129880862 model
-
First, update the
evaluate.py
file, and set themodel_dir=None
means that the script will load the latest model or set a model folder to load the specific one likemodel_dir=exp_1679619309663310
to loadexp_1679619309663310
model. -
Update the
features_kwargs
to the best set from the tokens search -
And run the following script to evaluate
python evaluate.py
# Train
python train_and_eval_t5-large-TLS-3.py
python tokens_pruning.py --n-trials=150 --lang=en --phase=valid --model-name=None
#E.g., --model-name=exp_1679326129880862 to load exp_1679326129880862 model
-
First, update the
evaluate.py
file, and set themodel_dir=None
means that the script will load the latest model or set a model folder to load the specific one likemodel_dir=exp_1679619309663310
to loadexp_1679619309663310
model. -
Update the
features_kwargs
to the best set from the tokens search -
And run the following script to evaluate
python evaluate.py
# Train
python train_and_eval_mTLS.py
sh train_and_eval_mTLS-tokens-search.sh
-
First, update the
evaluate.py
file, and set themodel_dir=None
means that the script will load the latest model or set a model folder to load the specific one likemodel_dir=exp_1679619309663310
to loadexp_1679619309663310
model. -
Update the
features_kwargs
to the best set from the tokens search for each language -
And run the following script to evaluate
python evaluate-mTLS.py