Abstract
Urban planning must be able to perceive and respond to the sentiments of city residents. Spatial-temporal data from social media comments contains a vast amount of subjective information, which can support condition analysis and the evaluation of planning proposals. This study takes Chengdu as a case study, employing natural language processing (NLP) techniques, such as sentiment analysis and topic extraction, to create “Urban Sentiment Maps” tailored to the practical needs of urban planning. These maps have been applied in different kinds of projects, enhancing the accuracy of condition analysis and the scientific validity of planning, ultimately improving post-evaluation of proposals.
Keywords
Research background
Urban sentiments refer to the collective emotions of all individuals, reflecting the genuine emotional experiences of city residents during various activities such as work, travel, daily life, and leisure. It is widely recognized through studies that the built environment plays a crucial role in influencing urban sentiments (Dan et al., 2022; Jian et al., 2016). By delving into urban sentiments, we can uncover the demands across five basic dimensions: time, space, behavior, perception, and interest (Figure 1), which can better assist in spatial planning, facility layout, and quality improvement in the city, ultimately leading to more “emotionally resonant” and “human-centered” planning proposals.

Identified the “five dimensions” of demands through emotional data recognition.
In the context of the Fourth Industrial Revolution, artificial intelligence has brought new development opportunities to urban studies (Hong, 2024; Long and Zhang, 2024). With the iteration of urban observation methods, the primary source of urban sentiments has gradually shifted from offline questionnaires to online social media comments (Kong et al., 2022; Zhang et al., 2022; Zhang et al., 2023). This change has enhanced the coverage, sample size, and accuracy of urban sentiments research, leading to corresponding studies and applications in fields such as city parks (Hadavi, 2017) and consumption spaces (Jia et al., 2024). However, the aforementioned research primarily focuses on the exploratory phase in China. Research on emotional perception using deep learning and natural language processing techniques is relatively limited, especially in terms of emotional perception and evaluation based on geotagged social media data (Cui et al., 2021). In this context, in order to precisely understand the demands of city residents and improve living environments through planning strategies that meet their needs, this study is hereby conducted.
Research methodology
Research scope
As the capital of Sichuan Province, Chengdu exhibits the common development characteristics and transformation needs of mega-cities, should pay more attention to and respond to the demands of city residents. This study focuses on the central urban area of Chengdu, which includes 14 districts such as Jinjiang District and Chenghua District (Figure 2). These districts are categorized into “Old town (inside the 1st ring road),” “Core area (inside the 4th ring road),” and “Suburban area (outside the 4th ring road).” According to statistics, these regions have the highest population density, urbanization levels, and internet user density in Chengdu, providing valuable information for this research.

Research scope.
Research data
This research involves three main types of data:
Emotional data: including comments obtained from social platforms such as Weibo, REDnote, and Dianping, covering users’ IDs, comment timestamps, content, and geographic information from August to October in 2023. The pre-processing steps include null value removal, coordinate correction, and elimination of data outside the study area, resulting in 31.4 million usable records.
Built environment data: including spatial data on land use properties, roads, railways, etc., primarily sourced from official surveys of land-use change.
Urban operational data: including employment density, traffic congestion, and temperature, etc., primarily obtained from official surveys.
The emotional data is used to extract the demands of city residents in five dimensions, particularly focusing on their genuine feelings and concerns. Meanwhile, the built environment and urban operational data are used to objectively quantify the correlation between these feelings and concerns, in order to explore specific applications of sentiments in urban planning. It is worth mentioning that since the comment data is sourced from online media, it cannot effectively capture the emotional needs of certain groups, such as the elderly and children, who may not use smartphones. As a result, the scoring outcomes exhibit a certain degree of bias.
Technical approach
Emotional data is a form of spatial-temporal data in textual form. Extracting the five dimensions—time, space, behavior, perception, and interest—requires the use of Natural Language Processing (NLP) techniques. Specifically, the extraction of “time,” “space,” “behavior,” and “interest” employs the Subject Vocabulary Extraction method, which identifies subjective vocabulary by utilizing contextual features and statistical information of words (Jing and Hao, 2010), while the extraction of “perception” utilizes the Sentiment Analysis method.
To enhance the accuracy of extraction and align with Chengdu’s localized characteristics, this study utilizes a customized corpus as the analytical foundation. Our corpus integrates common vocabulary, open-source Chinese corpora, Chengdu dialect vocabulary, and proprietary vocabulary for urban planning, covering a total of 60,000 words. These words are classified into five categories: time, space, behavior, perception, and interest, with specific corpora built for each dimension. The structure of the corpus includes fields such as serial number, word, part of speech, sentiment tendency, and sentiment intensity. For example, in the perception category, expressions unique to Chengdu residents are included, such as local language terms like “bang ying” (too tough to chew), “li che huo” (unreliable), and “jing jiao huan” (noisy). In the subsequent analysis, it was shown that the recognition accuracy using open-source corpora was 54%, while the accuracy increased to 71% when combined with a customized corpus, indicating a significant improvement. The initial results are obtained through Corpus Matching using the above two methods, which then serve as the basis for training deep learning models, ultimately achieving large-scale and batch extraction (Figure 3).

Technical steps for constructing a “sentiment map” and detecting emotional factors.
The methods of recognition and scoring method are highly generalizable. However, due to linguistic differences across regions, directly applying the corpus from this study may result in biased outcomes. To implement this method in other cities, it is necessary to develop a local corpus, incorporating elements such as landmark names and dialects, to achieve localized adaptation.
To further explore the correlation between sentiments and interests, and to better guide scientific proposals, the “Interest” Corpus in this study is subdivided into seven categories based on the focus areas in urban planning and spatial governance (Table 1). These categories include: (1) functional types; (2) transportation; (3) space elements; (4) facilities and equipment; (5) commercial operations; (6) ecological environment; and (7) history and culture. Through vocabulary matching, elements related to sentiments can be identified from comments, and the Generalized Additive Mixed Model (GAMM) is then employed to further explore the correlation between these elements and sentiments. GAMM is a widely used model for spatial correlation analysis. Its advantage lies in its ability to fit nonlinear relationships between independent and dependent variables using smooth functions. In this study, residents’ ratings were used as the dependent variable, while various factors of the urban built environment served as independent variables (Table 2). Ultimately identifying the planning factors that genuinely affect the sentiments of city residents.
Example of “interest” corpus types.
Regression results of GAMM.
“*” represents the significance level of the factor in the statistical test.
Research findings
Analysis of overall sentiments
Overall, the average sentiment score in the central urban areas is 0.57, indicating a “relatively positive” state, which is consistent with the general impressions of Chengdu residents, who tend to be “optimistic and positive.” In terms of spatial distribution, taking the geographic center (Tianfu Square) as a reference point and distributing outward, the sentiments within the central urban area show a pattern of “relatively negative—neutral—relatively positive—relatively positive” (Figure 4).

Emotional state in the central urban area of Chengdu.
Specifically, the old town and Gaoxin District have relatively high construction density and population concentration, with the lowest average sentiment scores of 0.37 and 0.48, both categorized as “relatively negative.” In contrast, sentiments in the core area are relatively better, falling into the “neutral” to “relatively positive” range. And suburban areas have seen a significant increase in permanent residents in recent years, showing a generally better sentiment status.
Sentiments influencing factors
The regression analysis results using the GAMM model reveal the importance ranking of sentiments influencing factors in the central urban area of Chengdu as follows: Ecological environment > Spatial elements> Commercial operations> Historical and cultural ≈ Transportation> Functional types > Facilities and equipment. Among these, the top 10 factors associated with positive sentiments include Sunlight, Views of snowy mountains, Flowers, Delicious food, Hotpot, Mahjong, Tea drinking, Unobstructed traffic, Shopping, and Historical sites. Conversely, the top 10 factors associated with negative sentiments include Rainy season, Traffic congestion, Disturbance to residents, Noise, Rent, Dirtiness, Old communities, Parking issues, Homogenization, and Smelly water (Figure 5). Among the ecological environment influencing factors, terms such as “sun” and “seeing snow-capped mountains” are synonymous with sunny and pollution-free, while “rainy season” and “water odor” are key elements of negative emotions.

The main factors influencing urban sentiments in the central urban area of Chengdu.
Spatial distribution of sentiment status
By visualizing the analysis results, sentiment status can be directly reflected in specific neighborhoods or even individual plots, assisting in determining the genuine demands of city residents.
The key words such as “hotpot,” “mahjong,” and “tea drinking” represent an ideal lifestyle in Chengdu, which is mainly distributed in the old town (Figure 6). Since many residents primarily live in the old city districts, authentic hotpot restaurants, mahjong parlors, and teahouses are predominantly located there. These establishments not only provide entertainment and leisure spaces for the local population but also attract many tourists seeking an authentic experience. In contrast, the key words such as “noise,” “parking issues,” and “dirtiness” represent disorder in urban spaces, and also appear in residential clusters within the old town. This is a manifestation of the struggle with spatial disorder while enjoying the ideal life for local residents, indicating that the spaces carrying the lively life in Chengdu need continuous improvements in governance to maintain their cultural heritage.

The spatial distribution of subjective vocabulary such as “hotpot,” “mahjong,” etc.
Public service facilities, commercial layout, and urban quality are the main concerns of new residents in suburban areas, such as Xindu District, Shuangliu District, and Longquanyi District (Figure 7). These areas generally exhibit positive sentiments due to their favorable ecological environment, pleasant spatial scale, and convenient living facilities. However, negative sentiments arise from issues such as renting and purchasing houses, insufficient public service facilities, and deteriorating conditions. Therefore, suburban areas should emphasize housing security, the construction of quality public services, and urban renewal to meet the demands of the growing population.

The spatial distribution of subjective vocabulary such as “facilities,” “rent,” etc.
Subjective terms like “sun” are primarily associated with spaces such as employment centers, parks, and residential communities, indicating that Chengdu residents have a high demand for “sunbathing spaces.” On the other hand, subjective terms like “seeing snow-capped mountains” are mainly linked to spaces in the high-tech district with dense high-rise buildings, suggesting that the employment population in this area has a strong preference for open-view spaces (Figure 8).

The spatial distribution of subjective terms like “sun” and “seeing snow-capped mountains.”
Exploration of application base on functional requirements
This study applies the analysis results of sentiment maps to initial demand mining, functional combination identification, and implementation evaluation of planning proposals.
As for initial demand mining, sentiment maps are used to deeply explore the genuine demands of city residents within the planning area, guiding the scientific formulation of planning strategies. In the case of old communities, residents’ overall evaluation about their living environment, their main complaints, and the spatial distribution of these concerns (Figure 9), especially the spatial demands for amenities, such as sports and cultural facilities, medical facilities, elderly care facilities, and educational facilities, etc., help guide the precise placement of these amenities within the planning proposals. Through the above analysis, the scientific layout of public service facilities has been significantly improved, achieving maximum population coverage with limited resource allocation.

Example of demand mining and analysis based on sentiment maps.
As for functional combination identification, sentiment maps can be used to find the correlation between relevant planning elements and figure out the optimal combination of different functional elements. Taking cultural establishments as an example, the Jinjiang Cultural Center was selected as the research subject. Firstly, spatial proximity was determined based on location, where shorter distances indicate closer spatial adjacency. Secondly, passenger flow was used to assess the intensity of visitor connections between different business types and the Jinjiang Cultural Center, with stronger flow connections indicating closer interactions. Finally, emotional data were analyzed to evaluate the degree of mutual benefit. If the ratings of establishments surrounding the Jinjiang Cultural Center are generally higher than those further away, it indicates a positive mutual benefit effect. Through this approach, it is possible to identify business types that align well with the Jinjiang Cultural Center among the various establishments in the area. This helps in forming specific business combinations and provides guidance for future business planning.
As for implementation evaluation of planning proposals, sentiment maps can be used to compare residents’ feedback before and after project implementation. For instance, according to the reflected demands, the corresponding cross-river bridge can be planned and located. Further analysis of the sentiments after the bridge’s construction can provide insights into the specific impacts of factors such as connection methods, landscape design, and road width, etc. By making these comparisons, planners can identify applicable planning concepts and experiences, leading to the development of corresponding guidelines and providing a “toolbox” for subsequent related projects.
Conclusion
A deep understanding of the demands of city residents is crucial for the transformation of urban construction and the enhancement of quality toward a more refined approach. The analysis of “urban sentiments” based on social media comments offers a new perspective and method for in-depth research on these demands. Theoretically, this paper elaborates on the definition and research content of “urban sentiments” and explores methods for analyzing them. In practice, using Chengdu as a case study, this paper analyzes the spatial distribution of sentiments and draws “sentiment maps” to identify the main factors affecting residents’ sentiments, demonstrating how these maps can be applied in urban planning, offering valuable guidance in the allocation of public services, the layout of commercial operations, and the enhancement of environmental quality, and further supporting the exploration of humanistic demands and providing valuable insights for the transformation of urban planning in mega-cities.
In planning practice, this study accurately identifies residents’ sentiments and demands, leading to several applications:
In the Chengdu Consumption Space Specific Plan, sentiment analysis guided the scientific layout of consumption spaces, providing a reference for their operation.
In the Chengdu Sports Facilities Specific Plan, sentiment analysis enabled the precise optimization of sports facilities to meet residents’ demands.
In the Chengdu Jinjiang River Ecological Plan, sentiment analysis facilitated a scientific evaluation, promoting a harmonious balance between production, living, and ecology.
For future research, three directions will be considered:
Continuous emotion tracking: Implement continuous monitoring of emotional changes among city residents in specific areas of Chengdu. This would facilitate the identification of patterns, analysis of underlying causes, and ultimately the proposal of optimization strategies.
Comparative studies across cities: Conduct similar studies in other cities and compare the findings with those from Chengdu. This approach would help identify Chengdu’s strengths and weaknesses, providing insights to promote more human-centered urban planning and renewal.
Application in specialized studies: Apply this method to thematic studies such as “community renewal,” “park evaluation,” and “consumer space assessment” to support spatial evaluation and analysis within these contexts.
Footnotes
Ethical approval and informed consent statements
Our institution does not require ethical approval for reporting individual cases or case series.
Data availability statement
Only sharing metadata about the research data.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
