My own codebase for experimenting with Sentence Represenantations for Advanced Topics in Computational Semantics
encoders/ # sentence encoders: including lstms and mean of embeddings
heads/ # classification heads that take embeddings for specific datasets (e.g. SNLI)
utils/ # various auxiliary functions with mixed use
train.py # main script for training (see section 3)
eval.py # main script for evaluation (see section 4)
Extra directories which are created during setup:
runs/ # directory with all models and tensorboard runs
pretrained/ # directory with glove embeddings
tokenized/ # directory where tokenized data is stored for efficiency
You can download my runs here
conda env create --name acts_gpu --file=acts_gpu.yaml
source activate acts_gpu
bash download_glove.sh
Clone repo from FAIR github to this directory
git clone https://github.com/facebookresearch/SentEval.git
cd SentEval/
Install SentEval
python setup.py install
Download datasets
cd data/downstream/
./get_transfer_data.bash
Install environment using
sbatch install_environment.jobRun interactive session
srun --partition=gpu --gpus=1 --ntasks=1 --cpus-per-task=18 --time=04:00:00 --pty bash -iAnd later
module purge
module load 2022
module load Anaconda3/2022.05
source activate acts_gpuExample for LSTM:
python3 train_snli.py --encoder lstm --max_epochs 50 --batch_size 64 --optimizer_lr 0.1 --encoding_dim 2048 --lr_decay 0.99
Currently supported encoders: mean_embeddings lstm bilstm bilstm_max
Example for LSTM:
python3 eval.py --transfer --snli --path runs/exp_20240418_145108_lstm_2048/model_13_checkpoint.pickle