# Emotion Recognition Method for Call/Contact Centre Systems
## 4 Methods
### Techniques Used in Text Channel  
Vectorization methods can be considered in the context of how to improve emotion recognition in text channels. In neural network classification, it is possible to use a complete utterance as the input of the classifier. However, for simpler classifiers, additional techniques are needed to prepare the input data adequately. For this purpose, a technique based on word weighting was used [63]. The method allows for preparation of statistics on the occurrence of individual words in the whole utterance. With this technique, it is possible to determine how often a word occurs in a given utterance. It also provides opportunities to identify the words that have the most meaning in an utterance. This is accomplished by assessing the frequency of specific words across all utterances. The method described is shown in Figure 2. The first step performed is to evaluate the number of occurrences of each word in the utterance, denoted as TF. If certain words are repeated in a given utterance then ultimately these words may have a greater impact on the classification score. The second step is to calculate the IDF value. This factor is calculated according to the following formula [64,65]:  
\[\text{IDF}(w)=\ln\biggl{(}\frac{1+\text{N}}{1+\text{D}(w)}\biggr{)}+1 \tag{1}\]  
where: \(w\)--given word; N--number of all chats; D(\(w\))--number of chats containing word \(w\). The use of IDF allows higher weights to be assigned to words that are most likely to be important in the classification process. On the other hand, popular words that appear in most chats will have low weights. To calculate the final word weight, both TF technique and IDF technique were used according to the formula [64,65]:  
\[\text{TF}|\text{IDF}(w)=\text{TF}(w)\cdot\text{IDF}(w) \tag{2}\]  
Figure 2: The vectorization technique used in the proposed approach. LEGEND: TF—term frequency; IDF—inverse document frequency; L2—normalization. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Method** & **ACC** & **WAP** & **WAF1** \\ \hline RandomOS & 0.61 & 0.69 & 0.64 \\ SMOTE & 0.63 & 0.68 & 0.65 \\ ADASYN & 0.63 & 0.68 & 0.64 \\ RandomUS & 0.50 & 0.64 & 0.53 \\ NearMiss & 0.31 & 0.58 & 0.35 \\ CondensedNN & 0.68 & 0.68 & 0.63 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Classification results using the SVM algorithm. The final step is to apply L2 normalization according to the formula [66]:  
\[\mathrm{L2(TF|IDF(}w_{i})\,)=\frac{\mathrm{TF|IDF(}w_{i})}{\sqrt{\mathrm{TF|IDF(}w _{1})^{2}+\ldots+\mathrm{TF|IDF(}w_{k})^{2}}} \tag{3}\]  
where: \(w_{i}\)--the \(i\)-\(th\) word in the utterance; \(k\)--the number of words in the utterance. Emotions constitute another element having a significant impact on the effectiveness of emotion recognition in CC text channels. In recent years, they have been very common and increasingly used during conversations in text channels. These types of signs are helpful in determining the emotions expressed by interlocutors, so it is essential to include them in the automatic emotion recognition method being developed. The assignment of emoticons identified in CC text channel conversations to specific classes defining emotions was made according to the assumptions developed in the paper [54]. Table 6 lists the groups of emoticons that are associated with a particular type of emotion. These signs were also included in the developed algorithms, which improved the efficiency of correct recognition of emotional states. Most of the icons presented were also identified by the judges in the process of evaluating the databases used for the purposes of this paper. The majority of identified signs were those associated with the emotion HAPPINESS, which is probably due to the conversation topics chosen for the study. This class is also one of the most numerous. However, if the topic of conversation was, for example, related to the area of debt collection then it can be assumed that the number of emoticons identifying the types of negative emotions would be much greater.