Code for *SEM paper Length-Aware Multi-Kernel Transformer for Long Document Classification
torch>=1.9.0
transformers>=4.9.0
scikit-learn>=0.24.1
tqdm>=4.61.1
numpy>=1.20.1
datasets>=1.12.1
nltk>=3.5
scipy>=1.6.3The project is organized as follows:
myexperiments/: Contains dataset-specific experiment scriptstrainer.py: The customized Huggingface trainer classLAMKIT.py: The proposed LAMKIT model class{Dataset}.py: The main program for specific {Dataset}
myscripts/: Contains shell scripts for running experiments with specific hyperparametersREADME.md: Project documentation and instructions
For the easiest way to reproduce the results
- Modify the dataset path in the myexperiments folder. For example, in
myexperiments/mimic3.py, locate line 259 and update theload_dataset()function call:
train_dataset = load_dataset("path/to/your/dataset")- Set the hyperparameters in the myscript folder (e.g.,
myscripts/mimic-roberta.sh) - Run the shell script file. For example
sh myscripts/mimic-roberta.sh