Technical requirements
The code that we will go over in this chapter makes use of a number of open source software libraries and resources. We have used many of these in earlier chapters, but we will list them here for convenience:
- The Tensorflow machine learning libraries:
hub
,text
, andtf-models
- The Python numerical package, NumPy
- The Matplotlib plotting and graphical package
- The IMDb movie reviews dataset
- scikit-learn’s
sklearn.model_selection
to do the training, validation, and test split - A BERT model from TensorFlow Hub: we’re using this one –
'small_bert/bert_en_uncased_L-4_H-512_A-8'
– but you can use any other BERT model you like, bearing in mind that larger models might take a long time to train
Note that we have kept the models relatively small here so that they don’t require an especially powerful computer. The examples in this chapter were tested on a Windows 10 machine with an Intel 3.4 GHz...