This is a dataset for binary sentiment classification containing substantially more data than previous benchmark datasets. The description provided on the Stanford website:
BERT FINETUNE MOVIE
I will use the well known movies reviews positive - negative labeled Large Movie Review Dataset. This notebook will cover fine-tune transformers for binary classification task. There are 73 models that worked and 33 models that failed to work with this notebook. The list of pretrained transformers models that work with this notebook can be found This way you know ahead of time if the model you plan to use works with this code without any modifications.
I ran this notebook across all the pretrained models found on Hugging Face Transformer. Since the name of the notebooks is finetune_transformers it should work with more than one type of transformers. When there is a need to run a different transformer model architecture, which one would work with this code? There are rare cases where I use a different model than Bert when dealing with classification from text data. What transformers models work with this notebook? As long as this statement holds, the rest of the code will work! The DataLoader will return a dictionary of batch inputs format so that it can be fed straight to the model using the statement: outputs = model(**batch). The only modifications needed to use your own dataset will be in reading in the dataset inside the MovieReviewsDataset class which uses PyTorch Dataset. The way I load the dataset into the PyTorch Dataset class is pretty standard and can be easily reused for any other dataset. I built this notebook with reusability in mind. Knowing a littleīit about the transformers library helps too. Since I am using PyTorch to fine-tune our transformers models any knowledge on PyTorch is very useful. I provided enough instructions and comments to be able to follow along with minimum Python coding knowledge.
This allows for code reusability on a large number of transformers models!
This functionality can guess a model's configuration, tokenizer and architecture just by passing in the model's name. Transformer by Hugging Face functionality. This notebook is using the AutoClasses from
BERT FINETUNE HOW TO
The focus of this tutorial will be on the code itself and how to adjust it to your needs. This notebook is designed to use a pretrained transformers model and fine-tune it on a classification task. Fine-tune Transformers in PyTorch using Hugging Face Transformers Complete tutorial on how to fine-tune 73 transformer models for text classification - no code changes necessary!