bert movie reviews sentiment classifier
1.0.0
使用Google的Bert語言模型構建電影評論情感分類器
這是使用Google的Bert(來自Transformers的雙向編碼器表示)NLP語言模型來構建電影評論情感分類器的示例。
該代碼需要scikit-learn , tensorflow-gpu , tensorflow-hub , bert-tensorflow 。該代碼與TF <= 1.1.50兼容,並在Tensorflow Hub上使用最新的BERT模型。要使用CPU版本,請安裝tensorflow==1.15.0 。
pip install scikit-learn
pip install tensorflow-gpu==1.15.0
pip install tensorflow-hub
pip install bert-tensorflow要運行這個項目,您可以
打開ipython筆記本src/bert_sentiment_classifier-local.ipynb在您的juypter筆記本中或
使用GPU後端導入src/bert_sentiment_classifier.ipynb進入Google的COLAB。
在VisualStudio代碼中打開Pyhon Interactive src/bert_sentiment_classifier.py 。請參閱此處如何與Jupyter筆記本電腦和代碼一起使用。