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笔记本电脑和代码一起使用。