The presented scientific article is a comprehensive study of machine learning and deep learning methods in the context of emotion recognition in text data. The main goal of the study is to conduct a comprehensive analysis and comparison of various machine learning and deep learning methods to classify emotions in text. During the work, special attention was paid to the analysis of traditional machine learning algorithms, such as multinomial naive Bayes (MNB), multilayer perceptron (MLP), and support vector machine (SVM), as well as the use of deep learning methods based on long short-term memory (LSTM). The experimental part of the study involves the analysis of different data sets covering a variety of text styles and contexts. The experimental results are analyzed in detail, identifying the advantages and limitations of each method. The article provides practical recommendations for choosing the optimal method depending on the specific tasks and context of the application. The data obtained is important for the development of intelligent systems that can effectively adapt to the emotional aspects of interaction with users. Overall, this work makes a significant contribution to the field of emotion recognition in text and provides a basis for further research in this area.