With the rapid growth in social network comments, the need for more effective methods to classify their polarity—negative, neutral, or positive—has become essential. Sentiment analysis, powered by natural language processing, has evolved significantly with the adoption of advanced deep learning techniques. Long Short-Term Memory networks capture long-range dependencies in text, while transformers, with their attention mechanisms, excel at preserving contextual meaning and handling high-dimensional, semantically complex data. This study compares the performance of sentiment analysis models based on LSTM and BERT architectures using key evaluation metrics. The dataset consists of business reviews from the Yelp Open Dataset. We tested LSTM-based methods against BERT and its variants—RoBERTa, BERTweet, and DistilBERT—leveraging popular pipelines from the Hugging Face Hub. A class-by-class performance analysis is presented, revealing that more complex BERT-based models do not always guarantee superior results in the classification of Yelp reviews. Additionally, the use of bidirectionality in LSTMs does not necessarily lead to better performance. However, across a diversity of test sets, transformer models outperform traditional RNN-based models, as their generalization capability is greater than that of a simple LSTM model.
Business diversity in proximity-based environments is emerging as an important requirement in urban planning, especially with the rise of concepts such as the 15-min city, which aim to enhance urban vitality. While many studies have focused on assessing vitality through the conditions defined by Jane Jacobs, few have specifically measured commercial diversity and analyzed its relationship with place popularity, attendance, and tourism activity. Using geo-localized data on businesses and Google Maps reviews in Paris, a diversity index was constructed based on Shannon entropy derived from business categories—Culture and leisure, Food and beverage, Retail stores, Local services—and explored its correlations through statistical analysis. The study reveals a higher level of commercial diversity in central areas compared to the outskirts, as indicated by spatial clustering analysis, along with a positive association between diversity and attendance. However, no significant relationship was observed between commercial diversity and the popularity of the selected establishments. These findings may inform policymakers and urban planners in designing more locally diversified cities and, more broadly, in promoting sustainable urban vitality.