October 26, 2026
Automatic Classification of Mobile App Feedbacks by Supervised Machine Learning
Rene Muniz Morelo; Edilson José Rodrigues
DOI: 10.22167/2675-6528-202603408
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
A computational model was developed and evaluated for the automatic classification of textual feedbacks from mobile applications, employing Natural Language Processing (NLP) techniques and supervised machine learning algorithms. The objective was to develop and evaluate a model to automatically categorize these feedbacks. A dataset of 58,242 records was used, consisting of user comments from the Android platform, categorized into 33 thematic dimensions of the digital experience, sourced from Customer Experience Survey (CES) research. The methodological pipeline included textual normalization, removal of Portuguese stopwords via Natural Language Toolkit (NLTK), vectorization by CountVectorizer with a vocabulary of 1,000 tokens, and the incorporation of the contextual variable responseSelection via binary encoding, followed by the concatenation of attribute matrices. More than 30 supervised algorithms were evaluated by stratified cross-validation (k=5), with ExtraTreesClassifier and RandomForestClassifier showing the best performances. Random Forest, selected as the main model, was optimized via GridSearchCV. The model achieved an average accuracy of 0.8634 (±0.0046) in cross-validation and an accuracy of 0.86, macro-F1 of 0.84, and weighted-F1 of 0.86 on the independent test set. The results indicated robust technical viability for the automation of large-scale feedback screening, with performance varying between categories according to their support volume.
Keywords: Supervised Learning; Multiclass Classification; Customer Experience Survey; Ensemble methods; Natural Language Processing.
1. Introduction
The growing expansion of mobile applications, which have established themselves as the main interface for digital consumption and relationships, has generated substantial volumes of unstructured textual records. These data, spontaneously produced by users, are collected in contexts such as Customer Experience Survey (CES) research. Comments, reviews, and experience reports constitute a strategic source of information about perceptions, expectations, and failures in digital products. However, the magnitude of this phenomenon makes manual screening and categorization of this information unfeasible, especially in organizations with a large number of active users and dozens of thematic categories to monitor simultaneously.
The automation of this process, through Natural Language Processing (NLP) techniques and supervised machine learning algorithms, emerges as a methodologically robust solution. This approach allows for the transformation of unstructured text into categorized and actionable data. Supervised text classification, as established by Jurafsky and Martin (2023), consists of the automatic assignment of predefined labels to documents based on statistical patterns learned from labeled examples, being particularly suitable for the categorization of thematic feedbacks in domains with well-defined taxonomies.
In the field of Customer Experience Management (CX), the systematization of feedbacks is an integral part of the Voice of the Customer (VoC) strategy, which seeks to convert qualitative perceptions into quantifiable metrics to guide strategic decisions (Lemon and Verhoef, 2016). The absence of automated screening mechanisms compromises the timeliness and comprehensiveness of analyses. This limits the organizational capacity to identify emerging patterns of dissatisfaction in dimensions such as Onboarding, Payment, Security, and Cancellation, and to respond proactively to reported issues.
Ensemble-based models, both bagging, such as Random Forest (Breiman, 2001), and boosting, such as gradient boosting (Chen and Guestrin, 2016), have demonstrated superior performance in high-dimensionality textual classification tasks, which result from document vectorization. The effectiveness of committee methods in reducing the variance and bias of individual predictors is widely documented in the literature (Dietterich, 2000). The Bag-of-Words representation, although it does not capture higher-order semantic relationships, shows recognized effectiveness in categorical classification scenarios with a limited thematic vocabulary (Manning et al., 2008). The combination of these techniques configures an approach with relatively low computational cost and high interpretability, characteristics relevant for implementation in corporate environments.
Given this scenario, the present study sought to answer the research question on how to apply NLP techniques and supervised learning to automatically classify textual feedbacks from mobile applications into relevant thematic categories, efficiently and scalably. The justification is based on two complementary axes: from an applied point of view, the automation of CES feedback triage represents a significant operational gain for organizations that depend on continuous analysis of user perception to guide the digital product development cycle; from an academic point of view, the study contributes to the consolidation of empirical evidence on the effectiveness of ensemble methods in granular multiclass classification scenarios with 33 categories in Portuguese, a context still little explored in the national literature of Data Science and Analytics. The general objective was to develop and evaluate an automatic classification model for these feedbacks.
2. Material and Methods
This study was characterized as an applied research, quantitative in nature, with a methodological approach focused on the development and evaluation of a computational model. The general objective was to develop and evaluate an automatic classification model for textual feedbacks from mobile applications, employing Natural Language Processing (NLP) techniques and supervised machine learning algorithms. The research was conducted based on a Data Science pipeline, covering from data preparation to model optimization and evaluation.
The unit of analysis was composed of textual feedback from mobile application users on the Android platform, categorized into 33 thematic dimensions of the digital experience. The database used totaled 58,242 records, obtained from Excel spreadsheets that simulated Customer Experience Survey (CES) research. The data were synthetically generated by a dedicated Python script, which randomly filled in the DsComentario, DsCategoria, and respostaSelecao fields, maintaining the structure and statistical conditions of a real database.
The generation of synthetic data ensured the absence of personally identifiable or corporate information, in compliance with CNS Resolution n° 510/2016. An Ethical Considerations Form (ECF) was completed, indicating the non-existence of ethical risks associated with the research. This procedure ensured the reproducibility of the experiment and adherence to ethical considerations, providing sufficient volume and diversity for training and evaluating classification algorithms.
Text preprocessing was performed using the `preparar_dados()` function, developed in Python. The steps included removing records with missing values in the DsComentario, DsCategoria, and respostaSelecao columns, using the `dropna()` method. Subsequently, the list of Portuguese stopwords was obtained from the Natural Language Toolkit [NLTK] library (Bird et al., 2009).
The vectorization of the DsComentario textual field was performed with CountVectorizer, using Portuguese stopwords and a vocabulary restricted to 1,000 tokens (`max_features=1.000`), generating a sparse matrix of token counts, known as Bag-of-Words representation. This approach, although it does not capture long-distance semantic relationships, is recognized for its effectiveness in textual classification with a delimited thematic vocabulary (Manning et al., 2008; Salton and McGill, 1983).
The contextual variable `respostaSelecao`, which indicates the user journey stage, was vectorized independently via CountVectorizer with `max_features=500`. The two resulting feature matrices, one for the textual comment and another for the contextual variable, were then horizontally concatenated using `np.hstack()`, forming the final feature vector. The incorporation of the `respostaSelecao` variable enriched the representation with contextual information, a strategy consistent with Aggarwal (2018).
The preprocessed data were divided into training and testing sets in an 80% and 20% proportion, respectively, using the `train_test_split()` function with `random_state=42`. After removing incomplete records, the effective base for modeling totaled approximately 11,640 records, resulting in about 9,312 instances for training and 2,328 for testing. The test set was kept isolated throughout the model selection and optimization process to ensure an unbiased performance evaluation.
The comparative evaluation phase of algorithms involved the analysis of over 30 supervised learning algorithms, implemented in the scikit-learn library (Pedregosa et al., 2011). Linear models, decision tree-based classifiers, ensemble methods, artificial neural networks, and semi-supervised learning algorithms were tested. The evaluation was performed by stratified cross-validation with five folds (k=5), using the `evaluate_model_kfold()` function.
Stratified cross-validation (StratifiedKFold, `shuffle=True`, `random_state=42`) is a well-established resampling technique for estimating generalization error (Stone, 1974). The results indicated superior performance of ensemble-based methods, with ExtraTreesClassifier (Geurts et al., 2006) and RandomForestClassifier leading the average accuracy ranking.
The RandomForestClassifier was selected as the main model due to its high predictive performance, stability attested by cross-validation, and interpretability. The optimization of the Random Forest model’s hyperparameters was conducted by the `refinar_modelo()` function via GridSearchCV with five-fold cross-validation (`cv=5`), evaluating 24 hyperparameter combinations.
The search grid comprised the following hyperparameters: `n_estimators` (100, 200), `max_depth` (None, 10, 20), `min_samples_split` (2, 5), and `min_samples_leaf` (1, 2), totaling 120 fits. After optimization, the trained model and the text and step vectorizers were serialized and persisted via the joblib library in the files `modelo_randomforest.pkl`, `vectorizer_texto.pkl`, and `vectorizer_etapa.pkl`, respectively, to allow for production-time inference through the `prever_categoria_completa()` function.
3. Results and Discussion
The research results demonstrate robust technical feasibility for the automatic classification of textual feedbacks from mobile applications, employing a combination of Natural Language Processing techniques and supervised machine learning algorithms. The developed model, an optimized Random Forest classifier, achieved consistent performance metrics, indicating its capability to efficiently categorize user comments into 33 thematic dimensions of the digital experience. The detailed analysis of the findings allowed not only for the quantification of the model’s effectiveness but also for the identification of error patterns and limitations inherent to the nature of the data and the methodological approach employed, providing valuable insights for future improvements and practical applications in corporate contexts.
Text preprocessing
Text preprocessing, a crucial step for data preparation, involved a sequence of procedures to transform raw comments into a format suitable for computational analysis. Initially, records with missing values in the DsComentario, DsCategoria, and respostaSelecao columns were removed, ensuring data integrity. Subsequently, Portuguese stopwords were removed using the Natural Language Toolkit (NLTK) library, which helped reduce dimensionality and focus on the most relevant terms for classification.
The vectorization of the DsComentario textual field was performed using CountVectorizer, configured with a vocabulary limited to 1,000 tokens, generating a sparse matrix of term counts, representing the Bag-of-Words approach. In parallel, the contextual variable respostaSelecao, indicating the user’s journey stage, was vectorized independently, with a limit of 500 tokens. The horizontal concatenation of these two matrices resulted in the final feature vector, enriching the representation of Feedbacks with contextual information, as suggested by Aggarwal (2018), and allowing the model to capture nuances that pure text might omit.
Data division and evaluation protocol
The effective database used for modeling, after removing incomplete records, totaled approximately 11,640 instances. This dataset was divided into training (80%) and testing (20%) sets using the train_test_split() function with a fixed random_state, resulting in 9,312 instances for training and 2,328 for testing. The test set was kept isolated throughout the entire model selection and optimization process, being used exclusively for the final performance evaluation, ensuring an unbiased assessment of the model’s generalization capability.
The model evaluation was performed by stratified k-fold cross-validation with k=5 folds, a robust technique for estimating generalization error, as highlighted by Stone (1974). The accuracies obtained in the five folds were 0.8630, 0.8681, 0.8612, 0.8685, and 0.8560, resulting in an average accuracy of 0.8634 with a standard deviation of 0.0046. These values demonstrate high consistency among the partitions, reflecting the model’s stability against variations in training data composition and reinforcing the reliability of the performance metrics.
Comparative evaluation of algorithms
In the preliminary selection phase, more than 30 supervised learning algorithms from the scikit-learn library were compared, encompassing linear models, decision tree-based classifiers, ensemble methods, artificial neural networks, and semi-supervised algorithms. The evaluation was based on the average accuracy obtained by cross-validation on the training set. The results showed the superiority of ensemble-based methods, with ExtraTreesClassifier (Geurts et al., 2006) and RandomForestClassifier leading the performance ranking.
Other algorithms such as MLPClassifier, DecisionTreeClassifier, and LabelPropagation also presented an average accuracy above 0.85, demonstrating good performance. In contrast, models with average accuracy below 0.40, such as GaussianNB, AdaBoostClassifier, and DummyClassifier, proved incompatible with the complexity of the 33-category classification problem. Linear models like LogisticRegression and LinearSVC achieved accuracies between 0.77 and 0.81, being competitive but inferior to top ensemble methods.
The choice of Random Forest as the main model was based on multiple criteria, including its high predictive performance, stability confirmed by cross-validation, robustness to textual noise common in Customer Experience Survey (CES) data, and its superior interpretability compared to neural network models, a characteristic valued in corporate environments. The combination of these factors positioned Random Forest as the most suitable option for the study’s objective.
Hyperparameter optimization
The hyperparameter optimization of the Random Forest model was conducted using GridSearchCV with cross-validation (cv=5), exploring 24 hyperparameter combinations. The search grid included n_estimators (100, 200), max_depth (None, 10, 20), min_samples_split (2, 5), and min_samples_leaf (1, 2), totaling 120 fits. The average time per fit ranged from 5.5 seconds for configurations with max_depth=10 to 23.7 seconds for configurations with max_depth=None and n_estimators=200, evidencing the computational cost associated with unrestricted tree depth.
The optimal configuration identified for the Random Forest was: n_estimators=200, max_depth=None, min_samples_split=2, and min_samples_leaf=1. The absence of a depth restriction (max_depth=None) suggests that the model benefits from unrestricted tree growth to capture more complex patterns present in the dataset, although this implies a longer training time. The trained model was serialized and persisted in .pkl files, allowing for its inference in production time through a dedicated function, facilitating its integration into operating systems.
Training set performance versus test set performance
The optimized Random Forest classifier demonstrated an accuracy of 0.98 on the training set, with a macro-F1 of 0.99 and a weighted-F1 of 0.98. When evaluated on the independent test set, the model achieved an accuracy of 0.86, macro-F1 of 0.84, and weighted-F1 of 0.86. The 12 percentage point difference between training and testing performance is indicative of moderate overfitting, which is an expected phenomenon in decision trees without depth restriction, as described in statistical learning theory (Hastie et al., 2009).
The cross-validation accuracy of 0.8634 (±0.0046) corroborates that the algorithm maintains stable performance on unseen partitions, generalizing adequately without significant loss of precision. The choice of metrics such as macro-F1 and weighted-F1 is particularly relevant for imbalanced multiclass classification scenarios, like the present study, as recommended by Sokolova and Lapalme (2009). The difference between macro-F1 (0.84) and weighted-F1 (0.86) suggests that the model performs better on the majority classes, while categories with lower support exhibit lower F1-scores.
Category classification report
The performance analysis by category revealed a strong correlation between the volume of available examples and the stability of the metrics. Well-represented categories with a clearly unambiguous thematic vocabulary, such as 3DS (256 instances, F1=0.92), Cancellation (406 instances, F1=0.91), Business (354 instances, F1=0.87), and Onboarding (210 instances, F1=0.90), maintained solid results, with F1-scores above or close to 0.90. This indicates that the model can learn distinctive patterns for these classes with a larger volume of data.
In contrast, categories with reduced support or significant lexical overlap showed lower performance. For example, Co-branded card (36 instances, F1=0.63), Payment (64 instances, F1=0.71), Checkout (117 instances, F1=0.77), and Stock (14 instances, F1=0.60) registered lower F1-scores. This asymmetry is a direct consequence of the class imbalance in the database, where categories with only two to four examples in the test set, such as B2B, Gift list, and Marketing, presented F1-scores of 1.00, 0.86, and 0.57, respectively, reflecting the high statistical variability arising from the reduced evaluation volume.
The low recall for the Stock category (0.43) deserves special attention, as only six out of 14 test examples were correctly classified. This suggests that the vocabulary used by users to report stock issues is often confused with neighboring categories, such as PDP/Content or Business. This impact is amplified by the reduced volume of training examples available for this category. A similar situation was observed with Search (recall=0.75, support=24) and Coupon (recall=0.67, support=48), whose typical lexical terms overlap with the Checkout and Business categories, contributing to model confusion.
Confusion matrix analysis and error patterns
The confusion matrix of the Random Forest model on the test set revealed that the correct predictions are predominantly concentrated on the main diagonal, aligning with the global accuracy of 0.86. The residual errors, however, were not randomly distributed but concentrated in pairs of categories with high semantic and lexical overlap. The most expressive confusion patterns included the prediction of Checkout as Business (10 instances) and Payment (5 instances), due to the checkout vocabulary being shared with transaction and negotiation terms.
Similarly, Payment was predicted as Business (3 instances) and Checkout (10 instances), reflecting the semantic proximity between these dimensions related to the purchase flow. The Security category was confused with 3DS (8 instances) and other authentication categories, as terms like ‘password’, ‘code’, and ‘access’ occur across these dimensions. Co-branded card was predicted as Payment (6 instances) and Business (21 instances), indicating that the specific vocabulary of this category was not sufficiently represented in the training corpus.
This confusion between categories is a limitation of the Bag-of-Words representation, which ignores the order of tokens and semantic context relations (Manning et al., 2008). In domains with multiple semantically close classes, the Bag-of-Words model lacks positional cues to resolve ambiguities. Contextualized representations, such as BERTimbau embeddings (Souza et al., 2020), could improve the separation of these groups by capturing the meaning of each token as a function of its neighbors in the sentence, which represents a technical gap to be explored in future iterations of the work.
The contextual variable respostaSelecao demonstrated a positive contribution to the model, being particularly useful in distinguishing between categories with predominantly shared textual vocabulary. Its incorporation, via attribute concatenation, acted as a complementary signal that reduced classification ambiguity in records with insufficient lexical content for a univocal distinction. This behavior is consistent with Aggarwal’s (2018) recommendations for enriching textual representations with contextual metadata, validating the strategy of including additional information beyond pure text.
In summary, the study demonstrated that the combination of Bag-of-Words textual representations and contextual attributes, processed by an optimized Random Forest classifier, offers a robust and stable solution for the automatic classification of mobile application feedbacks. Although the model presents a satisfactory global performance, the detailed analysis by category and confusion patterns revealed that data imbalance and the limitations of the Bag-of-Words representation are the main challenges, indicating the need for more sophisticated approaches for categories with low support or high lexical overlap in future research.
4. Conclusion
The present study developed and evaluated a computational model for the automatic classification of textual feedbacks from mobile applications into 33 thematic dimensions of the digital experience. It was found that the combination of Natural Language Processing techniques, such as vectorization by CountVectorizer, and supervised machine learning algorithms, notably the optimized Random Forest, produced robust results. The model achieved an accuracy of 0.86 on the independent test set, with a macro-F1 of 0.84 and a weighted-F1 of 0.86, and an average accuracy of 0.8634 (±0.0046) in cross-validation, demonstrating stability and generalization capability. It was observed that performance varied among categories, with classes having higher support and less ambiguous vocabulary, such as 3DS, Cancellation, and Onboarding, showing F1-scores above 0.90, while categories with lower data volume or lexical overlap, such as Stock and co-branded Card, registered lower F1-scores. The incorporation of the contextual variable responseSelection contributed positively to the distinction between categories with shared textual vocabulary.
The main practical contribution of this work lies in the technical feasibility of automating the large-scale screening of feedbacks, offering a significant operational gain for organizations that rely on continuous analysis of user perception to guide the development of digital products. Academically, the study consolidated empirical evidence on the effectiveness of ensemble methods in granular multiclass classification scenarios in Portuguese. However, the pronounced class imbalance and the limitations of the Bag-of-Words representation, which does not capture contextual semantic relationships, were identified as challenges, resulting in confusion between semantically close categories. For future studies, it is suggested to apply class balancing techniques, evaluate alternative textual representations such as contextualized embeddings (BERTimbau), investigate hierarchical category fusion strategies, and extend the training dataset with data from other platforms to assess model portability.
Bibliographic References
Aggarwal, C.C. 2018. Machine Learning for Text. Springer, Cham, Switzerland.
Bird, S.; Klein, E.; Loper, E. 2009. Natural Language Processing with Python: Analyzing Text with the Natural Language Toolkit. O’Reilly Media, Sebastopol, CA.
Breiman, L. 2001. Random Forests. Machine Learning 45(1): 5-32.
Chen, T.; Guestrin, C. 2016. XGBoost: A Scalable Tree Boosting System. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining: 785-794.
Dietterich, T.G. 2000. Ensemble methods in machine learning. Multiple Classifier Systems — Lecture Notes in Computer Science 1857: 1-15.
Geurts, P.; Ernst, D.; Wehenkel, L. 2006. Extremely randomized trees. Machine Learning 63(1): 3-42.
Hastie, T.; Tibshirani, R.; Friedman, J. 2009. The Elements of Statistical Learning: Data Mining, Inference and Prediction. 2ed. Springer, New York, NY.
Jurafsky, D.; Martin, J.H. 2023. Speech and Language Processing. 3ed. Disponível em: <https://web.stanford.edu/~jurafsky/slp3/>. Acesso em: 10 jan. 2025.
Lemon, K.N.; Verhoef, P.C. 2016. Understanding customer experience throughout the customer journey. Journal of Marketing 80(6): 69-96.
Manning, C.D.; Raghavan, P.; Schütze, H. 2008. Introduction to Information Retrieval. Cambridge University Press, Cambridge, UK.
Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; Vanderplas, J.; Passos, A.; Cournapeau, D.; Brucher, M.; Perrot, M.; Duchesnay, E. 2011. Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research 12: 2825-2830.
Salton, G.; McGill, M.J. 1983. Introduction to Modern Information Retrieval. McGraw-Hill, New York, NY.
Sokolova, M.; Lapalme, G. 2009. A systematic analysis of performance measures for classification tasks. Information Processing & Management 45(4): 427-437.
Souza, F.; Nogueira, R.; Lotufo, R. 2020. BERTimbau: Pretrained BERT Models for Brazilian Portuguese. Intelligent Systems — 9th Brazilian Conference on Intelligent Systems (BRACIS 2020): 403-417.
Stone, M. 1974. Cross-validatory choice and assessment of statistical predictions. Journal of the Royal Statistical Society: Series B (Methodological) 36(2): 111-133.
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