The paper considers sentiment analysis as a classification task. The models of an opinion target and of an opinionated document are described. Two compulsory lexicon classes (positive and negative) and two optional ones (mixed and neutral) are distinguished. Two categories of sentiment analysis methods are compared (supervised learning and unsupervised learning), their advantages and disadvantages are determined. Special attention is paid to the efficiency assessment of these methods with the use of the confusion matrix.