Skip to content

Instantly share code, notes, and snippets.

@emillykkejensen
emillykkejensen / MultiLabel_MultiClass_TextClassification_with_BERT_Transformer_and_Keras.py
Created August 21, 2020 10:23
Multi-Label, Multi-Class Text Classification with BERT, Transformer and Keras
#######################################
### -------- Load libraries ------- ###
# Load Huggingface transformers
from transformers import TFBertModel, BertConfig, BertTokenizerFast
# Then what you need from tensorflow.keras
from tensorflow.keras.layers import Input, Dropout, Dense
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam