eGitty

Discover The Most Popular Algorithms

An Implementation of Bert for Sentiment Analysis Using PyTorch

bert-sentiment, it is a bert transformer wrapper using pytorch. It can use google bert to run sentiment classification task.

An Implementation of Bert Using PyTorch for Sentiment Analysis

Database used in bert-sentiment

bert-sentiment use IMDB reviews dataset. You can download this dataset in here.

The accuracy of bert-sentiment

It can achieve 92% accuracy on guessing positivity / negativity on IMDB reviews.

How to use?

Step 1: Train weights

python script.py --train

Step 2: Evaluate weights

python script.py --evaluate

Step 3: Predict text

python script.py --predict "It was truly amazing experience."

You can download source code in here: bert-sentiment download

Leave a Reply

Your email address will not be published. Required fields are marked *