Skip to content

BERT, OpenAI GPT & GPT-2, and XLNet for classification. TensorFlow and PyTorch

License

Notifications You must be signed in to change notification settings

epsdg/text-classifiers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pretrained Text Classifiers

Jupyter/Colab notebooks with implementations of several pretrained language models for classification.

TensorFlow Models (TPU)

Based on original Google AI Research (BERT) and CMU/Google Brain (XLNet) implementations. Tested in colab using a cloud TPU v2. These support both binary and multi-label classification.

The models require I/O via Google Cloud Storage instead of the local file system attached to the colab instance.

PyTorch Models (GPU)

The PyTorch models currently support only binary classification.

Models were tested in colab using 1x NVIDIA Tesla T4 GPU. They will run on other CUDA devices with less memory, but require constraints on maximum sequence length and/or batch size, with significant impact on train time.

The models use NVIDIA Apex for mixed-precision scaling during training.

BERT uses the Hugging Face port of the original models to PyTorch

The OpenAI models (GPT & GPT2) use a fork of the above repo with a modification to support binary classification.

About

BERT, OpenAI GPT & GPT-2, and XLNet for classification. TensorFlow and PyTorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published