Monday, 18 September 2023

Sentiment Analysis in Natural Language Processing

What is Sentiment Analysis ?

Sentiment analysis which is also known as opinion mining is used to extract sentiment or opinions from a text data, text data such as feedback, comment, tweet, etc. The objective of sentiment analysis is to classify the text data in terms of positive or negative.

Key steps involved in sentiment analysis

  • Text Preprocessing
  1. Tokenization- Splitting the text data into individual words or tokens
  2. Lowercasing - Transforming the text data to lower case so that there is consistency across complete data.
  3. Stop word removal - Removing unnecessary words such as 'a','an','the', etc.
  4. Stemming or Lemmatization - Transforming words to the root word such as playing to play, etc.
  • Feature Extraction
  1. Bag of words - Text data is represented as frequency of words
  2. Term Frequency-Inverse Document Frequency (TF-IDF) - Weight words basis importance of words in overall document
  3. Word Embeddings - Pre-trained models can be use to create word vector, Ex.(Word2vec, Glove, etc.) to capture semantic meanings
  • Model Selection
  1. Lexicon based - If sentiment lexicons are used 
  2. Machine learning models - Supervised or unsupervised based machine learning models such as Naive Bayes, support vector machine, LSTM or transformer based models such as BERT
Applications of Sentiment Analysis

  • Customer feedback analysis - Analyze customer reviews data
  • Social Media Monitoring - Track and analyze sentiment expressed on social media
  •  Market Research - Understand public sentiment towards specific products

No comments:

Post a Comment