October 20, 2026
Automatic Classification and Triage of Tickets in Digital Banks Using Natural Language Processing
Automatic Classification and Triage of Tickets in Digital Banks Using Natural Language Processing
Ulisses de Melo Nascimento; Adâmara Santos Gonçalves Felício
DOI: 10.22167/2675-6528-202603518
Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
The growing demand for digital service in banks has driven the search for automated solutions for classifying and triaging calls. The study aimed to apply a set of machine learning techniques to generate automatic classification and triage of calls through natural language processing in digital banks. Six models (Naive Bayes, Logistic Regression, Support Vector Machine, Random Forest, Bidirectional Long Short-Term Memory, and Bidirectional Transformer Encoder Representations) were evaluated in categorizing urgency. A synthetic dataset of 10,000 records was used, generated by a compositional generator that simulated customer reports in eight service areas, with three urgency levels defined by business rules based on operational and financial impact. Texts were represented by Term Frequency – Inverse Document Frequency for classical models and by specific tokenization for deep learning models. Hyperparameter optimization was conducted by random search with stratified five-fold cross-validation. The results indicated that all models achieved a macro F1 score above 0.91, with BERT achieving the best performance (0.9358), followed by LSTM (0.9284). The cost-benefit analysis showed that Logistic Regression offered a favorable performance/cost ratio, training in five seconds compared to approximately five minutes for BERT. The most relevant finding relates to the impact of defining urgency based on objective business rules, which increased the macro F1 score by up to 15 percentage points compared to the previous approach based on emotional tone. It was concluded that Logistic Regression represents a balanced choice between performance and computational cost, while BERT is justified in scenarios demanding maximum accuracy, with the caveat of the need for validation with real production data in future work.
Keywords: Machine Learning; Digital banks; Text classification; Natural language processing; Call triage.
1. Introduction
The technological evolution and modernization of the digital financial sector have driven significant growth in customer service interactions, especially through electronic conversational channels, such as chats. This agility, although beneficial for the customer, has generated a growing volume of messages, presenting new operational challenges for financial institutions.
The high volume of messages hinders efficient classification and triage of customer service, resulting in slow and error-prone processes. Consequently, an increase in response time and customer dissatisfaction is observed. Manual analysis capacity is exceeded by the accelerated growth in data volume, creating a demand for automatic and efficient approaches (Zhang and Zhou, 2004).
In this scenario, applying text mining techniques in the financial sector enables the extraction of relevant information from unstructured data, supporting decision-making (Pejic Bach et al., 2019). Natural Language Processing (NLP) emerges as an alternative to automate the classification of customer messages, allowing for the automatic identification of the area and priority level of calls (Minaee et al., 2021). NLP-based support systems are crucial in the mobile internet era to offer fast and accurate support (Wang, 2018). Kowsari et al. (2019) demonstrate that the choice of text classification and textual representation algorithms depends on the specific characteristics of the domain and the dataset used.
The need for automated and efficient solutions to manage the growing volume of digital interactions in banks justifies the present research. The adoption of objective criteria based on business rules for defining urgency, instead of emotional factors, aims to improve the consistency of triage. The guiding hypothesis of this study is that machine learning techniques, supported by a definition of urgency based on objective business rules, allow the construction of automatic classifiers with sufficient performance to support the operational triage of customer service in digital banks. In this context, the present work aimed to apply a set of machine learning techniques to generate automatic classification and triage of support tickets through natural language processing in digital banks, identifying the most suitable approach in terms of accuracy and computational cost.
2. Material and Methods
The research conducted was characterized as exploratory and quantitative, with the purpose of identifying natural language processing techniques and machine learning models that presented the best performance in the automatic classification of calls in digital banks. The study focused on the application of a set of techniques to generate automatic classification and triage, aiming to improve operational efficiency and support triage in digital banks. The implementation of the models and procedures used the Python programming language, version 3.10, supported by several libraries.
For the classic models and random hyperparameter search, “scikit-learn” (Pedregosa et al., 2011) was employed. Data set manipulation and structuring were performed with “pandas” and “numpy”, while “matplotlib” and “seaborn” were used for exploratory analysis. The LSTM recurrent neural network was implemented with “PyTorch”, and BERTimbau (Souza et al., 2020) was loaded and fine-tuned with the Hugging Face “Transformers” library. The execution environment was Google Colab, with GPU acceleration, for training the deep learning models.
The dataset employed was synthetically generated through a compositional generator developed specifically for this work. The choice for synthetic data was justified by confidentiality issues and the unavailability of anonymized real data from financial institutions. The generator was designed to simulate digital bank customer reports, preserving narrative coherence and linguistic diversity.
The synthetic generation algorithm was centralized in the `gerador.py` script, structured in a modular architecture. The generation pipeline operated in four stages. Firstly, scenarios and lexical matrices were loaded, with 150 scenarios distributed among eight banking service areas (PIX, card, account, loan, investment, support, security, and registration), each specifying the call’s intent and the corresponding urgency class.
Next, “Slot Filling” was performed, where each scenario acted as a template with empty spaces, combining interchangeable elements to generate 2,507 base text variations. The third stage consisted of injecting randomness, with the algorithm randomly selecting and inserting variables such as fictitious names, values in reais, dates, store names, and error codes, to increase realism.
Finally, style variation and linguistic noise were applied, using five writing personas (formal, informal, telegraphic, verbose, irritated) and introducing natural digital environment noises, such as abbreviations and accent suppression. The final product of this process was a base of 10,000 totally unique, non-repetitive reports, where each record contained the customer’s report, the affected area, and the respective urgency (high, medium, or low).
The urgency classification was defined based on business rules that reflect the operational and financial impact of the problem, not the customer’s emotional tone. This approach ensured that automatic triage prioritized calls based on objective criteria. The three urgency levels adopted were: high, medium, and low.
High urgency was assigned to scenarios with active or imminent financial impact, complete operational blockage, or ongoing fraud, such as unauthorized transactions or cloned cards. Medium urgency covered real issues without immediate financial loss, such as operational inconveniences, pending processes, or application errors. Low urgency, on the other hand, included informational scenarios, doubts, or document requests without direct financial impact, such as fee inquiries or requests for duplicates.
Before training the models, an exploratory analysis of the dataset was performed to understand the distribution of variables, the balance between classes, and the linguistic characteristics of the reports. This analysis considered the distribution by service area, by urgency level, and the cross-relation between both, in addition to descriptive statistics of text length. The data distribution by service area was approximately uniform, with each area containing between 1,129 and 1,306 records. The urgency distribution followed the weights defined by business rules, with 38.5% medium urgency, 32.2% low, and 29.4% high. The analysis of report length indicated short and concentrated texts, with an average of 16.34 words per report and a median of 16 words.
For classic models, such as Naive Bayes, Logistic Regression, SVM, and Random Forest, the text was vectorized by the Term Frequency – Inverse Document Frequency (TF-IDF) technique. TF-IDF is a statistical weighting scheme that evaluates the importance of a term to a document in relation to a set of documents (“corpus”), according to Salton and Buckley (1988) and Spärck Jones (1972).
The TF-IDF hyperparameter optimization was performed together with the hyperparameters of each classifier through random search (“RandomizedSearchCV”). Combinations of maximum number of features, n-gram range (unigrams, bigrams, and trigrams), minimum and maximum document frequency, and sublinear scaling were evaluated.
For the LSTM model, a vocabulary was built from the training texts, with a minimum frequency of two. Simple tokenization was used, converting to lowercase and separating by non-alphanumeric characters, and padding up to a maximum length of 200 tokens. For BERT, the pre-trained tokenizer of the BERTimbau model (“neuralmind/bert-base-portuguese-cased”) was employed, with truncation and padding up to 256 tokens (Souza et al., 2020).
Six classification models were evaluated, covering classical and deep learning approaches. The classical models included Naive Bayes (ComplementNB), Logistic Regression, Support Vector Machine (LinearSVC), and Random Forest. The deep learning models were Bidirectional Long Short-Term Memory (LSTM) and Bidirectional Encoder Representations from Transformers (BERT) (BERTimbau).
For each model, multiple hyperparameter configurations were tested, reporting the best result obtained. All classical models were implemented using the “scikit-learn” library (Pedregosa et al., 2011). The selection of models considered methodological maturity, suitability for the data volume, and the possibility of cost-benefit analysis between linear, tree-based, and neural network approaches.
Hyperparameter optimization for the classic models was conducted by stratified cross-validation with five partitions (“folds”) on the training set, using “RandomizedSearchCV” with 200 iterations, as per Kohavi (1995). For the LSTM, an additional 10% of the data was set aside for validation. Class imbalance in the urgency variable was treated with class weights in models that benefited from this strategy.
The models’ performance was measured by widely used classification metrics: accuracy (proportion of total correct predictions), precision (proportion of true positives among those classified as positive), recall (proportion of true positives among those actually positive), and F1-score (harmonic mean of precision and recall), according to Sokolova and Lapalme (2009). The main comparison metric was the macro F1-score, which calculates the unweighted average of the F1-score of each class, treating all classes with equal importance, which is particularly suitable when urgency levels require distinct operational attention (Grandini et al., 2020).
3. Results and Discussion
The research had as its main objective to apply and evaluate a set of machine learning techniques for the automatic classification and triage of calls in digital banks, using natural language processing. The general results demonstrated that all six evaluated models achieved robust performance in urgency categorization, with the F1 macro measure exceeding 0.91. This initial finding underscores the viability of applying machine learning to optimize customer service processes in digital banking environments, according to the study’s guiding hypothesis.
The dataset used for training and evaluating the models was synthetically generated, comprising 10,000 records that simulated customer reports. This approach was necessary due to the confidentiality and unavailability of real anonymized data. The reports were distributed across eight banking service areas, such as PIX, card, and account, with a uniformity ranging between 1,129 and 1,306 records per sector. This balanced distribution was crucial to ensure that the models received a similar training volume for all classes, mitigating biases due to under-representation.
The definition of urgency for the calls was a central aspect of the methodology, based on objective business rules that considered the operational and financial impact of the problem, not the customer’s emotional tone. Three levels of urgency were established: high, medium, and low. The distribution of these levels in the dataset reflected operational reality, with 38.5% medium urgency, 32.2% low, and 29.4% high. This approach ensured that automatic triage prioritized calls based on consistent criteria, regardless of how the customer expressed their dissatisfaction.
Exploratory analysis of the dataset revealed that the reports were predominantly short and concentrated, with an average of 16.34 words per report and a median of 16 words. Percentiles indicated that most texts had a few dozen words, which was compatible with the “token” limits adopted in deep learning models, such as 200 for LSTM and 256 for BERT. A systematic difference in report length by urgency level was also observed, with the median increasing from 14 words for low urgency, 16 for medium, and 18 for high, suggesting that situations of greater severity tend to be described in more detail.
The textual representation of the data varied according to the nature of the models. For classical models, such as Naive Bayes, Logistic Regression, SVM, and Random Forest, the Term Frequency – Inverse Document Frequency (TF-IDF) technique was used. This statistical weighting scheme is effective in highlighting discriminative terms, penalizing those that occur frequently in many documents (Salton and Buckley, 1988; Spärck Jones, 1972). For deep learning models, LSTM and BERT, specific tokenizations were employed, with BERT using a pre-trained tokenizer in Brazilian Portuguese (Souza et al., 2020).
Hyperparameter optimization for the classic models was performed through stratified cross-validation with five partitions, using “RandomizedSearchCV” with 200 iterations, a strategy recognized for its efficiency (Bergstra and Bengio, 2012; Kohavi, 1995). For the LSTM model, 10% of the data were additionally separated for validation. Class imbalance in the urgency variable was treated with class weights in the models that benefited from this strategy, ensuring that all classes, although with different proportions, received adequate attention during training.
Comparative performance analysis
The comparative evaluation of the six models revealed that all achieved remarkable performance, with the macro F1 measure exceeding 0.91. The BERT model obtained the best result, with a macro F1 of 0.9358, closely followed by LSTM, which reached 0.9284. Among the classic models, Naive Bayes (0.9249), SVM (0.9243), and Logistic Regression (0.9237) showed practically equivalent performance, while Random Forest lagged slightly behind, with 0.9190. The total difference between the best and worst performance was less than two percentage points, indicating high homogeneity.
This proximity in results between such distinct approaches, from classical models to deep neural networks, is consistent with the principle that problem definition and feature engineering often have a greater impact on final performance than algorithm choice (Domingos, 2012). The predominantly lexical nature of the discriminant signal, as evidenced by Joulin et al. (2017), suggests that simple linear models can be competitive with deep learning architectures in tasks where the lexical signal is strong.
BERT, as a pre-trained Transformer model, has demonstrated its superior ability to capture contextual and long-range semantic nuances, which is particularly beneficial in domains with lexical ambiguity, where the same keyword can indicate distinct urgencies depending on the context (Devlin et al., 2019; Vaswani et al., 2017). The LSTM, in turn, has proven effective in modeling sequential dependencies in reports, relevant for expressions with negation and temporal chaining (Hochreiter and Schmidhuber, 1997; Graves and Schmidhuber, 2005).
The competitiveness of classical models, such as SVM and Logistic Regression, in high-dimensional sparse spaces generated by TF-IDF, is a recurring pattern in the literature (Joachims, 1998; Hastie et al., 2009). The performance of Naive Bayes, surprisingly competitive in this scenario, is attributed to the use of the ComplementNB variant, which mitigates the model’s simplifying assumptions in distributions with some class imbalance (Rennie et al., 2003). The robustness of these classical models, combined with their low computational cost, makes them important references.
From a cost-benefit perspective, Logistic Regression stood out for completing training in approximately five seconds, while BERT required about five minutes to achieve its performance. Although BERT presented a slightly superior macro F1 score (0.9358 versus 0.9237 for Logistic Regression), the difference of approximately 1.2 percentage points in the macro F1 score is contrasted by a difference of about sixty times in training time. This cost-benefit analysis is crucial for practical applications, where the computational and environmental costs of training deep learning models must be considered (Strubell et al., 2019).
A particularly relevant finding for ticket triage was the impact of defining urgency based on objective business rules. The adoption of these criteria, replacing previous approaches based on emotional tone, significantly reduced ambiguity between urgency classes. This resulted in more consistent decision boundaries, benefiting the performance of all models and raising the F1 macro measure by up to 15 percentage points compared to the previous approach, which often generated contradictory labels for reports with an emotional tone detached from the actual severity of the problem.
In comparison with the existing literature, the results of this study converge with the conclusions of Minaee et al. (2021) and Kowsari et al. (2019), who document the tendency of Transformer-based models to outperform classical approaches, albeit by small margins. The marginal difference between BERT and linear models, of approximately one percentage point, is also aligned with the findings of Joulin et al. (2017). However, the observed performances, with macro F1 above 0.91 for all models, were superior to the values typically reported in call classification tasks with real data, which range between 0.75 and 0.88 (Casanueva et al., 2020).
This contrast in absolute performance values is attributed to the controlled nature of the synthetic dataset, which has class boundaries defined by explicit rules. Although Casanueva et al. (2020) report an F1 score of 0.937 with BERT for banking intent detection in 77 classes, the comparison must consider the important differences: the synthetic dataset in this work has a more controlled distribution, the task involves only three urgency classes, and the boundaries were defined by clear business rules, which simplifies the classification task.
Limitations of the work
It is fundamental to consider some limitations for a precise interpretation of the findings. Firstly, the use of a synthetically generated dataset, although it has guaranteed control over class distribution, may not have captured all the linguistic diversity and complexity observed in real customer interactions. Consequently, the high performances (macro F1 above 0.91) may not be fully maintained in production data.
Secondly, the results are specific to the compositional generator developed and to the domain of Brazilian digital banks. This specificity requires caution in generalizing the findings to other contexts or languages. Furthermore, the scope of classes was restricted to eight service areas and three urgency levels, while real-world scenarios may require significantly more granular taxonomies for effective triage.
Third, the evaluation was performed exclusively in a controlled environment, without considering crucial operational factors such as latency, integration into production systems, and continuous human feedback. These elements directly affect the practical utility of classifiers in a real operating environment. Finally, the volume of 10,000 records, while sufficient for classic models, may be insufficient to fully explore the potential of BERT, whose relative advantage tends to increase with datasets larger than 50,000 records.
In summary, the research demonstrated that the application of machine learning techniques, especially when guided by an urgency definition based on objective business rules, is highly effective for classifying and triaging calls in digital banks. Models such as BERT and LSTM showed the best performance, while Logistic Regression emerged as a balanced alternative between accuracy and computational cost, confirming the hypothesis that automatic classifiers can support operational triage with sufficient performance.
4. Conclusion
The study aimed to apply a set of machine learning techniques to generate automatic classification and triage of calls through natural language processing in digital banks, identifying the most suitable approach in terms of accuracy and computational cost. It was found that all six evaluated models, including Naive Bayes, Logistic Regression, Support Vector Machine, Random Forest, bidirectional LSTM, and BERT, achieved robust performance in urgency categorization, with a macro F1 measure above 0.91. The BERT model obtained the best result, with 0.9358, followed by LSTM, with 0.9284. However, the cost-benefit analysis revealed that Logistic Regression offered a particularly favorable performance/cost ratio, completing training in approximately five seconds, in contrast to the approximately five minutes required by BERT. The most relevant finding of this work lies in the impact of the urgency definition based on objective business rules, which increased the macro F1 measure by up to 15 percentage points compared to previous approaches based on emotional tone. This study contributes by demonstrating the viability and effectiveness of automatic classifiers to support operational triage in digital banks, confirming that problem definition and feature engineering are determinants of performance.
Despite the promising results, the work presents some limitations. The use of a synthetic dataset, although controlled, may not have captured the full extent of real linguistic diversity, suggesting that the observed performances may not be fully maintained in production data. Furthermore, the findings are specific to the compositional generator and the Brazilian digital banking domain, limiting generalization. The evaluation was performed in a controlled environment, without considering operational factors such as latency and integration into production systems. For future studies, it is recommended to validate the models with real production data, expand the class taxonomy for more granular scenarios, and evaluate in a continuous usage environment with human feedback. Logistic Regression emerges as a balanced choice for scenarios with resource constraints, while BERT is justified in contexts demanding maximum accuracy.
Bibliographic References
MINAEE, S.; KALCHBRENNER, N.; CAMBRIA, E.; NIKZAD, N.; CHENAGHLU, M.; GAO, J. Deep Learning-Based Text Classification: A Comprehensive Review. ACM Computing Surveys, v. 54, n. 3, art. 62, p. 62:1–62:40, 2022. DOI: 10.1145/3439726.
PEJIĆ BACH, M.; KRSTIĆ, Ž.; SELJAN, S.; TURULJA, L. Text Mining for Big Data Analysis in Financial Sector: A Literature Review. Sustainability, v. 11, n. 5, p. 1277, 2019. DOI: 10.3390/su11051277.
WANG, Y. Intelligent Customer Service System Design Based on Natural Language Processing. In: Proceedings of the 2018 International Conference on Education, Economics and Educational Computing Systems
ZHANG, D.; ZHOU, L. Discovering Golden Nuggets: Data Mining in Financial Applications. IEEE Transactions on Systems, Man and Cybernetics — Part C: Applications and Reviews, v. 34, n. 4, p. 513-522, 2004. DOI: 10.1109/TSMCC.2004.829279.
Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform