January 08, 2026
Sentiment analysis in restaurant reviews in Campo Grande-RJ
Author: Josiane De Oliveira Da Silva — Advisor: Jose Guilherme Martins Dos Santos
Summary prepared by the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege focused on synthesis and writing.
This study developed and implemented a sentiment analysis model to classify customer reviews of restaurants in Campo Grande, Rio de Janeiro – RJ, published on Google Maps, as positive or negative. Based on the sentiments expressed, the research sought to understand customer perceptions and identify patterns of satisfaction and dissatisfaction, generating strategic insights to assist managers in identifying public preferences. The premise of the investigation is that the large amount of data generated by consumers on digital platforms represents a valuable, though underutilized, resource for management in the food sector.
The food service sector in Brazil, including bars and restaurants, showed average growth of 11% per year between 2009 and 2019 (SEBRAE, 2022). However, the Covid-19 crisis imposed challenges, with 77% of establishments operating at a loss in April 2021 (ABRASEL, 2021). The period from 2022 to 2024 was one of restructuring, culminating in a positive balance of 52,055 formal jobs created in the sector in the 12 months up to November 2024, with Rio de Janeiro contributing to this recovery (SINDRIO, 2025). Expectations for 2025 are optimistic, with 73% of entrepreneurs predicting an increase in sales (ABRASEL, 2024), but the sustainability of growth depends on internal management.
The high mortality rate of companies in the sector, where about 80% close before two years, is attributed to internal failures such as lack of planning, inadequate training, and, crucially, lack of consumer knowledge (SEBRAE, 2023). Bateson and Hoffman (2016) argue that service effectiveness is linked to understanding consumer behavior, especially in post-purchase evaluation, where active listening is fundamental. Kotler (2021) reinforces that successful companies systematically collect feedback to promote continuous improvement. Many managers, however, neglect this source of competitive intelligence (SEBRAE, 2016).
With digitalization, the customer journey and feedback generation have migrated to the online environment. Unstructured data generated by consumers can be transformed into strategic information with computational techniques (Hair et al., 2018). According to Limeira (2017), automatic methods for analyzing online conversations allow for agile and scalable market research. Sentiment analysis, a subfield of Natural Language Processing (NLP), is an approach to deal with the volume of texts and identify the polarity of opinions (Lima, 2021). However, a binary classification (positive/negative) may be insufficient.
The competitive advantage lies in a more granular analysis, which investigates sentiments associated with specific aspects such as food, service, ambiance, and price. Liu (2012) highlights that the objective of opinion mining is to discover sentiments about entities and their aspects. This approach allows us to identify, for example, that a customer is satisfied with the food but dissatisfied with the price, providing a diagnosis for corrective actions. This work applies this methodology to provide a tool for restaurant managers in Campo Grande, allowing them to align their services with public expectations and strengthen their market position.
The adopted methodology was quantitative, employing NLP and supervised machine learning. The process began with data collection, extracting textual reviews and star ratings (1 to 5) from restaurants in Campo Grande-RJ on Google Maps, published between 2022 and 2025. For extraction, web scraping was used with the Selenium library, effective for interacting with dynamic pages. According to Bird et al. (2009), Selenium simulates human navigation, allowing access to elements loaded via JavaScript. The process was configured with programmed pauses to avoid overloading servers.
After collection, the raw data underwent preprocessing. Texts from online reviews contain noise such as slang, spelling errors, and abbreviations, which can compromise the model’s performance (Provost and Fawcett, 2016). The treatment involved text normalization (conversion to lowercase, removal of non-textual elements) and stopword removal. For supervised modeling, the data were labeled. The initial strategy was to use star ratings as a proxy for sentiment (Liu, 2012). An exploratory analysis, with word clouds for each rating, was performed to validate the approach.
A challenge arose with the grade 3 ratings, considered neutral. To investigate their polarity, an analysis was conducted with the VADER and TextBlob libraries, after translating the texts into English (Pereira, 2022). The results indicated strong ambiguity, leading to the decision to exclude these ratings to avoid noise in the model. Preprocessing continued with tokenization, using the ToktokTokenizer, and the application of stemming to reduce words to their root, decreasing vocabulary dimensionality (Caseli and Nunes, 2024). With the text cleaned, the next step was vectorization.
For this task, the Term Frequency-Inverse Document Frequency (TF-IDF) technique was employed, which calculates a weight for each word based on its frequency and rarity, highlighting relevant terms (Pareek et al., 2024). To capture context, TF-IDF was combined with n-grams (unigrams, bigrams, and trigrams). The chosen classification model was Logistic Regression, a robust algorithm for binary classification in sentiment analysis due to its efficiency and interpretability (Silva, 2016). Given the class imbalance (majority of positive reviews), the parameter class_weight=’balanced’ was used, which adjusts class weights inversely proportional to their frequencies (Branco et al., 2015). Model evaluation used the confusion matrix and metrics such as accuracy, precision, recall, and F1-score, calculated for each class (Malakin, 2024; Géron, 2019).
The data collection resulted in a corpus of 7,082 reviews. Exploratory analysis revealed a concentration in 5-star reviews, a pattern consistent with studies pointing to a positive affective disposition towards food (Desmet and Schifferstein, 2008), indicating a probable class imbalance. The cleaning process confirmed the presence of typical challenges in user-generated data, such as grammatical errors and slang (Silva, 2016). Text standardization was crucial for data quality, aligned with good NLP practices (Pinna et al., 2020; Caseli and Nunes, 2024).
The treatment of 3-star reviews was a critical point. The word cloud for this category showed a balance between positive (“good”, “excellent”) and negative (“price”, “delay”) terms, suggesting an ambivalent experience. Polarity analysis with VADER and TextBlob confirmed this ambiguity. To increase the clarity of the training signal, it was decided to exclude these 723 reviews, an approach similar to that of Pang and Lee (2004), who demonstrated accuracy improvements by removing data of uncertain polarity. After filtering, ratings 1 and 2 were labeled as negative (class 0) and ratings 4 and 5 as positive (class 1), resulting in a dataset with 87% positive reviews.
The Logistic Regression model, trained with 70% of the data and tested with 30%, achieved an overall accuracy of 89%. A detailed analysis of the metrics per class, recommended for imbalanced data (Branco et al., 2015; Grandini et al., 2020), revealed nuances. The F1-score for the positive class (1) was 92%, indicating excellent performance. For the negative class (0), the F1-score was 79%. Although this is a good result, the difference shows that the model had more difficulty classifying the minority class reviews. This limitation is acceptable in the context of the study, but it points to opportunities for improvement, such as the application of resampling techniques (Branco et al., 2015).
The aspect-based analysis, which segmented the reviews into food, service, ambiance, and price, was the richest stage in insights. Aligned with the proposals of Shin et al. (2022), this approach allowed us to understand the specific drivers of satisfaction and dissatisfaction, fundamental concepts in marketing (Kotler and Keller, 2012). The “food” category was the most mentioned. Positive reviews highlighted terms such as “good” and “flavor,” while negative ones focused on “bad,” “salty,” and “always,” suggesting that inconsistency is a critical factor of dissatisfaction.
In customer service, cordiality and efficiency (“gentle”, “polite”) were the main compliments, while disorganization and mistreatment (“bad service”, “poorly served”) were the most forceful criticisms, reinforcing the importance of team training (Simões, 2015). The environmental analysis revealed that customers value “quiet”, “familiar”, and “cozy” spaces. On the other hand, lack of air conditioning (“hot”) and hygiene problems (“dirty”) were strong detractors from the experience, corroborating Carvalho’s (2019) research on the influence of the sensory environment.
The price category demonstrated the importance of value perception. Terms like “fair” and “cost-benefit” were central in positive evaluations, indicating that consumers seek a balanced relationship between cost and quality. Criticisms were marked by expressions like “not worth it” and “poor cost-benefit,” signaling that disproportionate prices generate strong dissatisfaction. These category-specific results provided the basis for a framework of strategic opportunities, translating data into actions such as standardization of recipes, team training, infrastructure improvements, and review of pricing strategies.
This study developed a sentiment analysis model to classify restaurant reviews in Campo Grande-RJ and extract insights. The methodology, from data collection with web scraping to modeling with Logistic Regression and aspect-based analysis, was effective in transforming textual data into business intelligence. The challenges faced, such as informal language, ambiguity of intermediate ratings, and class imbalance, were systematically addressed to ensure the robustness of the results. Excluding 3-star reviews, while simplifying the problem, ensured a clearer signal for the model, resulting in an overall accuracy of 89%.
The final model, despite superior performance for the positive class (F1-score of 92%) compared to the negative one (F1-score of 79%), proved to be a valuable tool. Category analysis (food, service, ambiance, and price) identified the main factors of satisfaction and dissatisfaction. Patterns were identified such as the appreciation of consistency in food, the importance of cordiality in service, the need for a clean and air-conditioned environment, and the search for a fair cost-benefit relationship. These findings translate into practical guidelines for managers to focus their improvement efforts. For future work, it is suggested to explore more advanced techniques for dealing with ambiguity and imbalance, such as transformer-based models and oversampling strategies.
It is concluded that the objective was achieved: it was demonstrated that the application of sentiment analysis techniques in online reviews is an accessible and high-impact tool for understanding public perception and generating competitive intelligence for the restaurant sector. The methodology and results provide a detailed diagnosis of the gastronomic scenario in Campo Grande-RJ, offering local managers a data-driven roadmap to improve their services, retain customers, and thrive in a competitive market.
References:
Associação Brasileira de Bares e Restaurante [ABRASEL]. 2021. Survey Economic Situation May 2021. Available at:< https://abrasel. com. br/noticias/noticias/alto-endividamento-pressiona-bares-e-restaurantes-diz-pesquisa-nacional-da-abrasel/ >. Accessed on: Feb 18, 2025.
Associação Brasileira de Bares e Restaurante [ABRASEL]. 2024. Survey Economic Situation December. Available at: < https://abrasel. com. br/noticias/noticias/bares-restaurantes-otimistas-primeiro-trimestre-2025-pesquisa-abrasel/ >. Accessed on: Feb 18, 2025.
Bateson, J. E. G.; Hoffman, K. D. 2016. Principles of Service Marketing: Concepts, strategies and cases. 3rd ed. +A Educação – Cengage Learning Brasil, Porto Alegre, RS, Brazil.
Bezerra, J. F.; Vasconcelos, R.; Leal, M. B. A.; Albuquerque, N. M. R. C. 2022. Restaurant management: a hospitality practice. Undergraduate Technological Course in Gastronomy. Centro Universitário Brasileiro, UNIBRA. Available at: < https://www. grupounibra. com/repositorio-unibra > , < gestao-de-restaurantes-uma-pratica-de-hospitalidade32. pdf >. Accessed on: Aug 16, 2025.
Bird, S.; Klein, E.; Loper, E. 2009. Natural Language Processing with Python. 1st ed. Sebastopol: O’Reilly Media.
Branco, P.; Torgo, L.; Ribeiro, R. P. A. 2015. A Survey of Predictive Modelling under Imbalanced Distributions. Faculty of Sciences. University of Porto. Available at: < https://arxiv. org/abs/1505.01658 >. Accessed on: Jun 06, 2025.
Carvalho, V. V. 2019. Analysis of the influence of the environment on customer satisfaction in a restaurant at Shopping Riomar. Monograph (Undergraduate in Administration). Department of Administration, Center for Applied Social Sciences. Federal University of Sergipe, São Cristóvão, SE, Brazil. Available at: < https://ri. ufs. br/handle/riufs/12419 >. Accessed on: Aug 15, 2025.
Caseli, H. M.; Nunes, M. G. V. 2024. Natural Language Processing: Concepts, Techniques and Applications in Portuguese. 3rd ed. BPLN. Available at: < https://brasileiraspln. com/livro-pln/3a-edicao >. Accessed on: Aug 15, 2025.
Desmet. P. M. A.; Schifferstein. H. N. J. 2008. Sources of positive and negative emotions in food experience. Department of Industrial Design, Delft University of Technology. Available at: < https://www. sciencedirect. com/science/article/abs/pii/S0195666307003364? via%3Dihub > Accessed on: Aug 15, 2025.
Géron, A. 2019. Hands-on: machine learning with Scikit-Learn & TensorFlow: concepts, tools and techniques for building intelligent systems. 576 p. Alta Books, Rio de Janeiro, Brazil.
Grandini. M.; Bagli. E.; Visani. G. 2020. Metrics for Multi-Class Classification: an Overview. Available at: < https://arxiv. org/abs/2008.05756 >. Accessed on: Aug 15, 2025.
Hair, J. F. Jr.; Harrison, D. E.; Rischer, J. J.2018. Marketing research in the 21st century: opportunities and challenges. Brazilian Journal of Marketing – BJMKT, v. 17, n. 5, p. Available at: < https://www. redalyc. org/journal/4717/471759753005/ >. Accessed on: Feb 18, 2025.
Kotler, P. 2021. Marketing For The 21st Century. p.33. Alta Books Publisher. E-book. Rio de Janeiro, Brazil.
Kotler, P.; Keller, K. L. 2012. Marketing management. 14th ed. Pearson Education do Brasil. São Paulo, Brazil.
Lima, Y. S. A. 2021. Sentiment analysis in knowledge-intensive scenarios. Available at: < https://www. puc-rio. br/ensinopesq/ccpg/pibic/relatorioresumo2021/download/relatorios/CTC/IND/INDYasmin%20Silva%20Amaro%20de%20Lima. pdf >. Accessed on: Feb 18, 2025.
Limeira, T. M. V. 2017. Brazilian consumer behavior. 2nd ed. p.64. Saraiva Uni. E-book. Rio de Janeiro, Brazil.
Liu, B. 2012. Sentiment analysis and opinion mining. San Rafael: Morgan & Claypool Publishers. San Rafael, CA, USA.
Malakin, L. A. 2024. Evaluation of Classifiers in Sentiment Analysis on Social Networks During the COVID-19 Pandemic. Dissertation. Master’s in Mathematics, Statistics and Computation. Institute of Mathematical and Computational Sciences, University of São Paulo, São Carlos, Brazil. Available at: < https://www. teses. usp. br/teses/disponiveis/55/55137/tde-05072024-112257/pt-br. php >. Accessed on: Aug 12, 2025.
Munzert, S.; Rubba, C.; Meibner, P.; Nyhuis, D. 2015. Automated data collection with R: A practical guide to web scraping and text mining. 1st ed. John Wiley & Sons, Ltd. United Kingdom.
Pang, B.; Lee, L. 2004. A sentimental education: sentiment analysis using subjectivity summarization based on minimum cuts. Available at: < https://arxiv. org/abs/cs/0409058 >. Accessed on: 06 Jun. 2025.
Pareek, A.; Saini, K.; Kumari, A.; Nikita, K. 2024. Restaurant Review Sentiment Analysis: An Automated Approach to Customer Feedback Analysis. Jaipur: Arya Institute of Engineering and Technology. Available at: < https://propulsiontechjournal. com/index. php/journal/article/view/2216 >. Accessed on: 13 Feb. 2025.
Pereira, F. V. 2022. Natural language processing for detecting patterns in the Brazilian stock market. Federal University of Santa Maria, Santa Maria, RS, Brazil. Available at: < https://propulsiontechjournal. com/index. php/journal/article/view/2216 >. Accessed on: 06 Jun. 2025.
Pinna, F. C. A.; Yamasaki, G. T. M.; La Rosa, I. A. S. 2020. Named Entity Recognition in the Portuguese Language. 78 p. University of São Paulo – USP, Polytechnic School, Department of Computer Science and Digital Systems – PCS. São Paulo, Brazil. Available at: < https://pcs. usp. br/pcspf/wp-content/uploads/sites/8/2020/12/MonografiaPCS3560SEM2020Grupo_S15. pdf >. Accessed on: 13 Feb. 2025.
Provost, F.; Fawcett, T. 2016. Data Science for Business. Translated by Data Science for Business. 408 p. Alta Books. Rio de Janeiro, Brazil.
Brazilian Service of Support to Micro and Small Enterprises [SEBRAE]. 2016. Eating out. São Paulo: Sebrae.
Executive summary from the Final Project of the Specialization in Data Science and Analytics from the MBA USP/Esalq
Learn more about the course; click here: