Deep Dive with Natural Language Processing Sentiment Analysis & Text Processing


Sentiment analysis is one of the big required domain of text processing and analyzing reviews of customers and it helps to improve business strategy and the security model of a product.


Others words:

It is a process of computationally determining whether a piece of written text word is positive, negative or neutral.

It is also known as opening mining, deriving the opening or the attitude of the speaker.

Important: There are two approaches to sentiment analysis.


  1. Lexicon based :  

“Here generally we split the text into smaller tokens and process is called tokenization then,

we count the number of times each word show up and this resulting model is called the bag of words model.


  1. Machine learning-based / Corpus-based

Here in deep neural networks, we build a more efficient model.


Why and where to use sentiment analysis.

  1. Public speaking and action : 

It is used in general sentiments calculation of publicly talking words and using the analyzer to get the environment of other dangerous activity.

  1. Politics 

To predict election result on behave of sentiment analysis of public reaction on behalf of action taken by government vs promises made by the government.

  1. Business 

To develop their marketing strategy to predict the success and failure of the product and improvement of QOS for food, hotel and many more.


Most popular Python and R  libraries for sentiment analysis.

  1.   NLTK 
  2.   Textblob
  3.   TM (text mining)   (R lang)
  4.   SpaCy
  5.   Core-NLP   (JAVA)
  6.   Gensim  
  7.   Tensorflow  CNN (conventional Neural Network)
  8.   Tensorflow  (LSTM Networks) Long short term memory units
  9.   RNN  (recurrent Neural Networks


Use cases : 

Important: prefer datasets which have to vary rare delimiter like tab \t



Installing  NLTK 

[email protected]:/work_hard/ML/NLP$ sudo pip3 install nltk

[sudo] password for code: 

Download corpus:

Leave a Reply

Your email address will not be published.

WhatsApp chat