Sentiment Analysis with the HuggingFace Transformers

The HuggingFace Transformers is one of the most advanced and easy to use collection of libraries for applying various ML models. Simply pick the most applicable pre-trained model to your domain and get the results right away! If we wanted to carry out text classification, and more specifically sentiment analysis, with HuggingFace it would be a 3 step-process:

  1. Pre-process text to generates tokens that the model can work with
  2. Feed token IDs into the model to obtain the activations
  3. Determine sentiment by converting activations into probabilities using a softmax function and then picking the max value via argmax

Here is how it might look like in Python:


 



 

Popular posts from this blog

Building an ML pipeline with ElasticSearch - Part 1

React.js + PeopleSoft = Love?

Stitching PeopleSoft and SharePoint