I have a large unlabeled dataset and I want to predict sentiment for each document in this dataset. I want to know, is it possible that I can use BERT for sentiment analysis of unlabeled data? I have seen so many tutorials and read the blog posts but I couldn't find one. All shows the use of BERT on datasets that are already labeled such as the IMDB review dataset or Yelp review.


Bert is a pre-trained language model with objectives like masked token prediction and next sentence prediction. So, it doesn't have any setup to do sentiment analysis,but you can use the pre-trained information to do the same.

There are couple of ways to solve your problem, they are

  1. Annotate few of your documents and fine-tune the model for sentiment analysis.
  2. Get open-source sentiment analysis datasets which fit your requirement, train Bert on the data and use the same classifier for your purpose (But this will work only if both data distributions look the same).
  • $\begingroup$ Thank you for your comment. Can you please share any tutorials or relevant resources where this kind of method (both of your suggestions) has been used? It would give me some background to proceed with my problem. $\endgroup$ – Piyush Ghasiya Oct 8 '20 at 10:07
  • 1
    $\begingroup$ For the first one, you need to annotate your data and refer these github.com/RaviTejaMaddhini/… or coursera.org/projects/sentiment-analysis-bert for doing sentiment analysis. I don't have any references for the second one. $\endgroup$ – RAVI TEJA M Oct 9 '20 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.