Skip to content

Multilingual Controllable Transformer-Based Lexical Simplification

Notifications You must be signed in to change notification settings

KimChengSHEANG/mTLS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multilingual Controllable Lexical Simplification

Requirements

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

Train and Evaluate the TLS-1 Model

Train

  • cd to the folder scripts
python train_and_eval_t5-large-TLS-1.py

Tokens value search

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

Evaluate

  • First, update the evaluate-TLS-1.py file, and set the model_dir=None means that the script will load the latest model or set a model folder to load the specific one like model_dir=exp_1679619309663310 to load exp_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 and Evaluate the TLS-2 Model

# Train 
python train_and_eval_t5-large-TLS-2.py

Tokens value search

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

Evaluate

  • First, update the evaluate.py file, and set the model_dir=None means that the script will load the latest model or set a model folder to load the specific one like model_dir=exp_1679619309663310 to load exp_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 and Evaluate the TLS-3 Model

# Train 
python train_and_eval_t5-large-TLS-3.py

Tokens value search

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

Evaluate

  • First, update the evaluate.py file, and set the model_dir=None means that the script will load the latest model or set a model folder to load the specific one like model_dir=exp_1679619309663310 to load exp_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 and Evaluate the mTLS Model

# Train 
python train_and_eval_mTLS.py

Tokens value search

sh train_and_eval_mTLS-tokens-search.sh

Evaluate

  • First, update the evaluate.py file, and set the model_dir=None means that the script will load the latest model or set a model folder to load the specific one like model_dir=exp_1679619309663310 to load exp_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

About

Multilingual Controllable Transformer-Based Lexical Simplification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published