Skip to content

soroushrasti/Bert_fine_tuning_classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

BERT Fine-Tuning Tutorial with PyTorch

I show you how to use BERT with the huggingface PyTorch library to quickly and efficiently fine-tune a model to get near state of the art performance in sentence classification.

What is BERT?

BERT (Bidirectional Encoder Representations from Transformers), released in late 2018, is the model I use here. BERT is a method of pretraining language representations that was used to create models that NLP practicioners usually used.

Advantages of Fine-Tuning

  1. Quicker Development

    • First, the pre-trained BERT model weights already encode a lot of information about our language. As a result, it takes much less time to train our fine-tuned model - it is as if we have already trained the bottom layers of our network extensively and only need to gently tune them while using their output as features for our classification task.
  2. Less Data

    • In addition and perhaps just as important, because of the pre-trained weights this method allows us to fine-tune our task on a much smaller dataset than would be required in a model that is built from scratch.
  3. Better Results

    • Finally, this simple fine-tuning procedure (typically adding one fully-connected layer on top of BERT and training for a few epochs) was shown to achieve state of the art results with minimal task-specific adjustments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages