-
To use fine-tune BERT for sentiment classification with HuggingFace's BERTForSequenceClassification on the IMDB dataset and then to serve the fine-tuned BERT model using Flask.
-
To experiment, understand and compare XLNet with BERT.
The motivation to using this dataset because it's already quite clean and has balanced classes: 50% positive and 50% negative reviews.
Using a single P100 GPU, these are the parameters that are used in order to fine-tune XLNet.
In train.py
:
train_dataset = IMDBXLNet(review=df_train.review.values,
label=df_train.sentiment.values,
max_len=768)
valid_dataset = IMDBXLNet(review=df_valid.review.values,
label=df_valid.sentiment.values,
max_len=768)
model = XLNetSentiment(train_dset=train_dataset,
eval_dset=valid_dataset,
train_batch_size = 6,
eval_batch_size = 6)