Back

Sentiment Analysis



Sentiment Analysis is the process of using natural language processing (NLP), machine learning, or data analysis techniques to determine the emotional tone behind a piece of text. It categorises opinions, emotions, or attitudes as positive, negative, or neutral, helping businesses and researchers understand public sentiment, customer feedback, or social media trends.

Implementation Steps


The below sentiment analysis was implemented using a Text classification model from Hugging Face website
Model: distilbert/distilbert-base-uncased-finetuned-sst-2-english.

This model can be found here

1. Get the API key from Hugging Face Website.
2. Integrate Hugging Face API to the application - I installed the axios package to make requests to the Hugging Face API from this webpage.
3. Pass the text entered to the model using API call, which returns back the result i.e whether the sentiment of the statement was Positive or Negative.

Example


Please enter sample text below and press the 'Analyze Sentiment' button