Sentiment analysis and opinion mining is the study of people's opinions, attitudes and emotions expressed in text towards entities. It is useful for businesses and consumers. Sentiment analysis can be done at the document, sentence and entity/aspect level. At the document level, a review is classified as overall positive or negative. At the sentence level, each sentence is classified. At the entity/aspect level, the specific attributes that people liked and disliked are identified. Automated sentiment analysis is needed due to the large volume of online opinions and human biases. Challenges include sarcasm, context dependence of words and implicit opinions. Supervised and unsupervised machine learning techniques are used for classification.