Fine tuning BERT for multi label or binary classification.
For multi label approach, only 2 files (run_glue.py and utils_glue.py) are modified from version 1.0.0. of huggingface/transformers.
Original multilabel sequence classification class can be found here: https://github.com/kaushaltrivedi/bert-toxic-comments-multilabel/blob/master/toxic-bert-multilabel-classification.ipynb
For binary classification approach, only 1 file (run_classifier.py) is modified from version 0.6.1. of huggingface/transformers.
Fine tuning longformer for multi label or binary classification.
Requirements are provided to create the environment. Jupyter notebooks have all the code. Helper functions are provided. Data is publicly available here: https://archive.ics.uci.edu/ml/machine-learning-databases/reuters21578-mld/ Code is compatible with huggingface/transformers version 4.11.3.