In literal terms, sentiment analysis is an analysis of people’s sentiments. It is a technique that classifies text data scraped from the internet based on the predicted underlying sentiments. An election campaign team can use sentiment analysis to identify individuals to target, who are more likely to vote for their candidate based on their online sentiments. Sentiment analysis can be used on its own to classify and interpret text-based data or used as a preliminary step for further analysis with logistic regression, naïve bayes or support vector machine.
Here, sentiment analysis is used to classify Trump's and Clinton's tweets.