This is the natural language processing coursework repository for our team..
- Boyu Han
- Xinyu Bai
- Yuze An
- imblearn
- pytorch
- simpletransformers
- transformers
- tensorboard
- numpy
- scipy
- scikit-learn
.
├── data `Preprocessed csv data for training and evaluation`
├── loader `Data loader`
├── main.py `Main python script to invoke functions`
├── model `All of our implemented models`
├── resource `Figures and data that is used to generate report`
├── runtime `Runtime cache and model checkpoints`
├── script `Scripts used to train on Slurm`
├── spec `Specifications of the task`
├── test `Python unittest directory`
└── util `Data analysis and performance optimization`python -u [--train int] [--model_name str] [--data_type type]- [--train ] the default value is
11: run training then testing0: return cached testing results of our final model: DeBERTaV2XLarge
- [--model_name ] determines which model to use and the default value is
DeBERTaV2XLarge- The value can be [
DeBERTaV3Large,DeBERTaV2XLarge,DeBERTaBase,DeBERTaLarge,XLNet,Longformer]
- The value can be [
- [--data_type ] determines which type of data to use and the default value is
clean_upsampleclean_upsample: Upsampled data without extra quotation markssynonym_clean_upsample: Upsampled data without extra quotation marks uses synonym data augmentation techniqueplain_upsample: Upsampled data
For example, you can train a DeBERTaV2XLarge model using clean_upsample data using:
python -u main.py --train 1 --model_name DeBERTaV2XLarge --data_type clean_upsampleNote:
- If you use
DeBERTaV2XLargewhich is our final model, an extra Bayesian Optimization step will be executed to maximize the model performance. - Due to the randomness in the initialization of the model and the randomized batch sampler, the f1-score may be slightly lower than what we stated on the paper. Also, we performed early-stopping per iteration which is not used in consideration of time in this training process. If you run the command directly, the model will be trained on 1 epoch and the results are collected afterwards.
- To reproduce our result, use early-stopping at about 4900 training iterations for batch size 3 (slightly less than 1 epoch) and train the model on full labelled dataset before invoking Bayesian Optimization methods.
For example, we can run dataloader unittest test with:
python -m unittest test.DataLoaderTest.LoaderTestCase.test_loaderRun LongformerLarge model training with:
python -m unittest test.LongformerLargeTest.LongformerLargeTestCase.test_trainMore tests are located within test folder.
All the results are stored in resource folder, including all figures, prediction files and labels.
Our final submission with final dataset on CodaLab
| Precision | Recall | F1-Score |
|---|---|---|
| 0.6154 | 0.6309 | 0.6231 |
Our final ranking on CodaLab Post-Evaluation Section
Statistics for training dataset
Reason to perform early-stopping
Bayesian Optimization steps



