Multiple Teachers Model for Ranking
The repository contains code implementation and dataset for paper Multilingual Serviceability Model for Ranking Help Requests on Social Media during Crisis Events.
- Download tweets based on ids' presented in the folder
data
. - Create 3 files: train.csv, val.csv, test.csv. Each file should contain two colimns: 'text' and 'label'.
Datasets for behavioral fine-tuning:
After downloading datasets, create 3 files train.csv, val.csv, test.csv and save the in the folder inside the data
folder. Each file should contain two colimns: 'text' and 'label'.
The code was tested on Python 3.10.
Install necessary dependencies with use of pip:
pip -r requirements.txt
- Command for task-related fine-tuning:
python finetune.py bert data teacher_1
where
- bert -- name of the model (could be bert or roberta)
- data -- folder with data
- teacher_1 -- name of folder for saving the task-related Teacher model
- Command for behavioral fine-tuning:
python finetune.py bert data/sarcasm teacher_2
where
- bert -- name of the model (could be bert or roberta)
- data/sarcasm -- folder with data for behavioral fine-tuning
- teacher_2 -- name of folder for saving the behavior-guided Teacher model
Command for model distillation:
python distillation.py model/teacher_1 model/teacher_2 model/teacher_3
where model/teacher_1
, model/teacher_2
, and model/teacher_3
- paths to finetuned models.