###### Abstract  
There are many ways people express their reactions in the media. Text data is one of them, for example, comments, reviews, blog posts, messages, etc. Analysis of emotions expressed there is in high demand nowadays for various purposes. This research provides a method of performing sentiment analysis of text information using machine learning. The authors trained a classifier based on the BERT encoder, which recognizes emotions in text messages in English written in chat style. To handle raw chat-style messages, authors developed an enhanced text standardization layer. The list of emotions identified includes admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire, disappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness, optimism, pride, realization, relief, remorse, sadness, and surprise. The model solves the problem of multiclass multilabel text classification, which means that more than one class can be predicted from one piece of text. The authors trained the model on the GoEmotions dataset, which consists of 54,263 text comments from Reddit. The model reached a macro-averaged F1-Score of 0.50704 in emotions prediction and 0.7349 in sentiments prediction on the testing dataset. The presented model increased the quality of emotions prediction by 10.2% and sentiments prediction by 6.5% in comparison to the baseline approach. BERT; emotions prediction; General Language Understanding Evaluation (GLUE); GoEmotions; sentiment analysis +
Footnote †: journal: Applied  
0000-0001-4000-0000-0000-0000-0000-0000-0000-0000-0000-00000-0000-00000-00000-00000-00000-00000-00000-00000-00000-00000-00000-00000-00000-000000-0000  
models were evaluated and performed well on the GLUE benchmark [3; 4; 5]. One of them is BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding [6]. The model itself does not solve any machine-learning problem, but per the authors of related work, \"pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models for a wide range of tasks, such as question answering and language inference, without substantial task-specific architecture modifications\". This study aims to apply the BERT encoder for training a classifier for the emotional analysis of text information. Modeling was performed on the GoEmotions dataset [7]. The dataset consists of chat-style written comments in English extracted from the Reddit platform [8]. The main contributions of this study are the following:  
* [noitemsep,topsep=0 pt]
* Approach to modeling on the GoEmotions dataset;
* Pre-process layer for chat-style text standardization;
* BERT-based classifier model for emotions prediction. All code presented in this study is published in the GitHub repository: [[https://github.com/Shoomher/sentiment-analysis](https://github.com/Shoomher/sentiment-analysis)]([https://github.com/Shoomher/sentiment-analysis](https://github.com/Shoomher/sentiment-analysis)) (accessed on 25 February 2024). It contains modules developed and a Jupyter notebook that shows the process of training and testing the model. The authors used the Python (v.2.2.1) programming language and the following libraries:  
* [noitemsep,topsep=0 pt]
* Pandas [9] for dataset investigation and manipulation;
* Numpy [10] for various array manipulations and calculations;
* Matplotlib [11] for data visualization;
* Unidecode [12] for fixing non-ASCII characters in data;
* TensorFlow [13; 14] for building, training, and evaluating neural networks;
* Scikit-learn [15] to calculate the receiver operating characteristic (ROC) curve, calculate the area under the curve, and create a multilabel confusion matrix. The next sections of this paper are organized as follows. Section 2 provides a discussion of related works. Section 3 describes the goal of the research paper and, based on it, defines the objectives of the research. In Section 4, a dataset investigation and preparation of text data for modeling is presented.