Build a Movie Reviews Sentiment Classifier with Google's BERT Language Model
This is a example of building a Movie Reviews Sentiment classifier with Google's BERT (Bidirectional Encoder Representations from Transformers) NLP Language Model.
This code requires scikit-learn
, tensorflow-gpu
, tensorflow-hub
, bert-tensorflow
. The code is compatibile with TF <= 1.1.50 and latest available BERT model on Tensorflow Hub. To use the cpu version please install tensorflow==1.15.0
.
pip install scikit-learn
pip install tensorflow-gpu==1.15.0
pip install tensorflow-hub
pip install bert-tensorflow
To run this project you can
-
Open the IPython Notebook
src/bert_sentiment_classifier-local.ipynb
in your Juypter Notebook or -
Import
src/bert_sentiment_classifier.ipynb
into Google's Colab with GPU backend. -
Open the Pyhon Interactive
src/bert_sentiment_classifier.py
in VisualStudio Code. See here how it works with Jupyter Notebooks and Code.