Next Article in Journal
The Relation of Surgical Procedures and Diagnosis Groups to Unplanned Readmission in Spinal Neurosurgery: A Retrospective Single Center Study
Next Article in Special Issue
A Machine Learning Classifier for Predicting Stable MCI Patients Using Gene Biomarkers
Previous Article in Journal
High Photocatalytic Activity of g-C3N4/La-N-TiO2 Composite with Nanoscale Heterojunctions for Degradation of Ciprofloxacin
Previous Article in Special Issue
Risk Assessment of Early Lung Cancer with LDCT and Health Examinations
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Exploring the Relationship between Urban Youth Sentiment and the Built Environment Using Machine Learning and Weibo Comments

Urban Mobility Institute, Tongji University, 4800 Cao’an Road, Shanghai 201804, China
*
Authors to whom correspondence should be addressed.
Int. J. Environ. Res. Public Health 2022, 19(8), 4794; https://doi.org/10.3390/ijerph19084794
Submission received: 27 February 2022 / Revised: 11 April 2022 / Accepted: 12 April 2022 / Published: 15 April 2022
(This article belongs to the Special Issue 2nd Edition of Big Data, Decision Models, and Public Health)

Abstract

:
As the relationship between the built environment and the sense of human experience becomes increasingly important, emotional geography has begun to focus on sentiments in space and time and improving the quality of urban construction from the perspective of public emotion and mental health. While youth is a powerful force in urban construction, there are no studies on the relationship between urban youth sentiments and the built environment. With the development of the Internet, social media has provided a large source of data for the metrics of youth sentiment. Based on data from more than 10,000 geolocated Sina Weibo comments posted over one week (from 19 to 25 July 2021) in Shanghai and using a machine learning algorithm for attention mechanism, this study calculates the sentiment label and sentiment intensity of each comment. Ten elements in five aspects were selected to assess the built environment at different scales and also to explore the correlations between built environment elements and sentiment intensity at different scales. The study finds that the overall sentiment of Shanghai youth tends to be negative. Sentiment intensity is significantly associated with most built environment elements at smaller scales. Urban youth have a higher proportion of both happy and sad sentiments, within which sad sentiments are more closely related to the built environment and are significantly related to all built environment elements. This study uses a deep learning algorithm to improve the accuracy of sentiment classification and confirms that the built environment has a great impact on sentiment. This research can help cities develop built environment optimization measures and policies to create positive emotional environments and enhance the well-being of urban youth.

1. Introduction

In recent years, with the continuous improvement of living standards, people have begun to pursue a better ecological environment and a happier life. In urban planning work, it is necessary to deal with the relationships involving various spatial interests, such as between urban construction space and ecological space, economic space and social space, and individual space and public space. In early urban construction, spatial evolution mainly expanded outward with construction, ignoring the sense of human experience in public space. At present, some megacities have entered the middle and late stages of urbanization, and urban construction has shifted toward a focus on internal renewal.
In Shanghai, for example, urban construction is mainly aimed at regenerating built-up land, which increases the need to evaluate and optimize the built-up environment. As the relationship between the built environment and people becomes increasingly important, greater emphasis should be placed on human-centered concepts in urban planning and design. In terms of the relationship between urban space and people, the degree to which the physical environment satisfies the physical and psychological needs of its users affects people’s sentiment and well-being.
Emotions, as a fundamental part of human behavior, fluctuate according to visual [1], environmental [2], and temporal [3] factors. There has been a lack of expression of emotion in urban construction and geography [4]. In the 1990s, Anderson and Smith proposed the concept of emotional geography, which focuses on the relationship between people, emotions, and space [5]. Emotional geography, which holds that emotion has temporal, spatial, and social characteristics, is an expansion of traditional Western geography [6]. The emergence of emotional geography marked the beginning of a transformation from a category of purely subjective mental notions to a broad social space. In terms of a research direction, emotional geography is based on geography, but it also involves many other fields, such as environmental science, biology, ecology, business, economics, sociology, and psychology; it is extremely interdisciplinary [7]. By studying medical environments, ecological environments, open spaces, and emotions, scholars have also realized that space is not a cold geometric; it also carries a wealth of people’s sentiments. In urban studies, attention to spatial emotions can help improve cities, enhance the quality of spaces, address urban socio-spatial inequalities, and enhance the well-being of residents.
Sentiment is an expression of emotion. With the rapid development of the Internet and the accelerated pace of life, social media has changed the way people share and collect information. For example, Twitter, Facebook, Weibo, and other platforms have gradually become the main channels for people to share their lives, collect information, and express their emotions. The rapid development of the Internet has produced what is called “big data”. In the study of urban issues, big data helps researchers to approach concepts from the perspective to the users, which is the key when focusing on human-centered concepts. At the same time, big data has also enriched basic information and analysis methods for planning research. In the past, to understand public feedback, statistical information and social research were formed mainly through questionnaires and interviews. The data obtained by these traditional methods are passive, static, and small-sample data, which have certain limitations. Big data, on the other hand, is relatively low-cost to obtain, and the data samples are large, dynamic, and sustainable. Using big data, it is easier to explore the relationship between people and the environment.
As the largest social media platform in China, Weibo has become a place for people to express their feelings and opinions; it has a wealth of user sentiment data [8]. In Shanghai, by the end of 2020, the permanent population was 24.8709 million, and the average age of the population was about 38. According to the “Weibo User Development Report in 2020”, those people born after the 1980s accounted for 96% of all active Weibo users (as shown in Figure 1). From the perspective of age composition, Weibo data can reflect the sentiment characteristics of most youth.
With the development of computer technology, techniques for mining emotions from text have emerged. Text sentiment analysis technology (TSAT) refers to the semantic orientation or polarity analysis of subjective attitudes and emotions in texts using natural language processing (NLP), statistical, or machine learning techniques. After continuous research and development, TSAT has been improved from a sentiment-dictionary-based method to a machine-learning-based method, and from supervised machine learning to deep learning. TSAT based on deep learning can be combined with spatial study, and good results have been obtained. However, current research is not yet sufficient to conduct fine-grain sentiment classification studies.
This research uses machine learning algorithms based on attention to analyze Weibo comments with fine-grain sentiment classification through data obtained from the Shanghai Weibo platform. By analyzing the distribution characteristics of urban youth sentiments and studying the relationship between sentiments and the built environment in Shanghai, this study enriches the research on emotion and space. From the perspective of sentiment, a non-traditional perspective of built environment evaluation is established to provide people-centered strategies for improving the quality of urban environment. Our study contributes mainly
  • To develop a novel and high-accuracy machine-learning-based method for analyzing youth sentiment in Shanghai.
  • To identify the determinants of sentiment as well as its relationship with the built environment in Shanghai.
  • Through the machine learning technology, which can be utilized as a sentiment feedback system for improvement of urban construction.

2. Literature Reviews

2.1. Research on the Relationship between Sentiment and Spatial Environment

Research on the relationship between sentiment and space dates back to the 1950s, when some scholars argued that space could cause emotions. In 1970s, Western scholars proposed concepts related to human-geographical emotions, such as geopathic episodes, sense of community, and sense of place [9]. With the continuing process of urbanization, studies on the relationship between cities and people from the perspective of emotions have gradually increased, such as traffic congestion and quality issues with facilities and services, which affect the construction of living environments and the development of cities. In 2008, ‘Emotion, Space and Society’, a special journal on emotional geography, began to be published in order to provide a broad platform for interdisciplinary research on the spatial and social aspects of emotion [10]. Many studies on emotion and space have emerged, providing a new perspective for the construction of the spatial environment.
From the perspective of research scale, research on the relationship between public sentiment and built environment has experienced a shift in focus from macro to micro. At the macro scale, some studies confirm that the built environment is accompanied by emotional characteristics in the development process. Dai et al. combined the emotional map with urban spatial structure, transportation networks, and land use and other built-environment information, and found that the spatial structure and spatial attributes of Shenzhen had certain emotional characteristics in the process of development [11]. Koenig conducted emotional analysis on the physiological level through data from wearables and found that the emotional changes of pedestrians are related to the spatial sequence changes of streets [12]. At a smaller scale, emotions take on different characteristics in different environmental spaces. Chen et al. used social network data to carry out perceptual evaluation of urban open space and found that positive emotions are mainly concentrated in entertainment, sports, and food service [13]. Cui et al. attempted to build a deep learning framework based on social media check-in data to evaluate and analyze spatial emotional perception, finding that the proportion of positive emotions showed an overall decrease with the increase of the distance from the city center [14]. Some scholars also use the spatial distribution of emotional characteristics to divide spatial groups and recognize urban functional areas. Cranshaw et al. used social media data to mine residents’ emotional data for dynamic identification of urban functional areas, and their results provide strong support for discovered clusters and reveal the distinctly characterized areas of the city [15]. In recent years, sentiment research has emerged in specific environments, such as hospitals, parks, schools, and stores. Rahim et al. constructed a sentiment analyzer and a medical environment classifier based on patient online reviews as a basis for healthcare service improvement [16]. Hannah et al. conducted text mining of reviews on Airbnb to explore the quality of indoor environments [17]. In a specific environment, it analyzes the sense of experience from the built environment from reviews in order to improve the built environment.
In short, people in different places carry out different activities and perform different behaviors, resulting in different emotions. People will affect the emotional airborne pattern of a place, and the built environment of a place will also affect people’s emotions. Research on the relationship between sentiment and spatial environment can help to discover urban space issues and improve positive sentiment [18].

2.2. Text Sentiment Analysis

Usually, there are several difficulties in sentiment recognition. These are as follows. First, each person’s expression of the same or similar sentiment is different, especially in Chinese [19,20,21]. An exclamation or even a punctuation change can cause a reversal of text sentiment, which leads to difficulties in text annotation. Secondly, it is difficult to classify sentiment, and sometimes it is difficult to precisely understand the real sentiment from a sentence (often need to combine with contextual information), which leads to difficulty in sentiment recognition [22].
At present, methods for text sentiment analysis mainly consist of the sentiment-dictionary-based method and the machine-learning-based method. The sentiment-dictionary-based method uses existing sentiment dictionaries for analysis so as to calculate the sentiment polarity (positive, negative, or neutral sentiment) and sentiment intensity of a text by counting and weighting the sentiment-related words that appear in the text [23]. On the other hand, the machine-learning-based method uses machine learning algorithms to train a classification model by training a dataset with labeled sentiment polarity. Then, the classification model predicts the sentiment to which the text belongs.

2.2.1. The Sentiment-Dictionary-Based Method

Sentiment dictionaries are used as an efficient analytical tool in sentiment analysis work. The construction of a sentiment dictionary is one of the most important basic tasks in the field of text mining. An appropriate sentiment dictionary plays an important role in the process of sentiment analysis, and it is important to select the appropriate method to build a domain-specific sentiment dictionary. Research institutions have released sentiment dictionaries such as HowNet [24], NTUSD [25], SentiWordNet [26], and Q-WordNet [27]. Turney’s work is representative of results based on the sentiment dictionary, using phrases containing adjectival adverbs as the main basis for determining sentiment polarity [28]. Using the Chinese emotion dictionary compiled by Hongfei’s team at Dalian University of Technology, Chao divided emotions into the seven categories of “joy”, “good”, “anger”, “sorrow”, “fear”, “evil”, and “shock” to evaluate the implementation of community emergency management projects from a public perspective [29]. In addition, Zhu proposed a new method for extracting Chinese microblogs’ subjective sentences, which is based on a combination of lexicon and corpus [30]. The sentiment-dictionary-based method needs the support of sentiment dictionary and judgment rules. The richer the sentiment dictionary, the more accurate the sentiment analysis will be.
However, there is no universal and complete sentiment dictionary, and common sentiment dictionaries do not perform well in scenario-specific research. With the development of the Internet, new Internet vocabularies are emerging. How to add these new online vocabularies to the existing sentiment dictionaries and construct a sentiment dictionary with high coverage has become a hot topic, with more and more research devoted to the automatic construction of sentiment dictionaries.
There are two main approaches for automatic construction of sentiment dictionaries: the semantic-dictionary-based approach and the corpus-based approach [31]. Tan used the HowNet sentiment dictionary as a basis and added the commonly used web terms from current dictionaries to construct a microblog emotion dictionary [32]. The experimental results showed that the semantic-dictionary-based approach achieved better results. Bai et al. presented a novel model to build a sentiment dictionary using the Word2vec tool based on our semantic orientation pointwise similarity distance (SO-SD) model [33]. This method enhances the automatic construction ability of a sentiment dictionary. In general, the sentiment-dictionary-based method also uses artificial intelligence techniques to automatically build sentiment dictionaries with broader coverage.

2.2.2. Machine-Learning-Based Method

Data-driven deep learning methods can greatly improve the extraction and recognition of textual information. At present, machine-learning-based text sentiment classification methods include supervised learning methods and semi-supervised learning methods, among which supervised learning methods are the most common. The supervised learning methods include naive Bayesian, KNN, SVM, and random forest, among others. Meral and Diri used plain Bayesian support vector machines for sentiment analysis of Turkish on Twitter [34]. Mohammad et al. described a state-of-the-art sentiment analysis system, based on a supervised statistical text classification that detects the sentiment of short informal textual messages such as tweets and SMS messages [35]. Xuehua et al. conducted an analysis of public opinion related to COVID-19 in China based on a potential Dirichlet allocation model and a random forest algorithm [36]. While supervised machine learning techniques require large amounts of labeled training data, some semi-supervised methods are also used in text sentiment classification because their performance is less dependent on test data.
Text sentiment classification models can be divided into shallow models and deep models [37,38,39]. For shallow learning models, naive Bayes was the first model to be used in text categorization tasks. With the development of integrated learning, XGBoost and LightGBM provide better predictive capabilities. These models played an important role in the pre-development of deep learning because they did not require excessive training data. However, feature engineering is a difficult task for such methods [40]. Before training the classifier, researchers must collect knowledge or experience to extract features from the original text. Shallow learning methods train the initial classifier based on various text features extracted from the original text. For small datasets, shallow learning models usually show better performance than deep learning models under the limitation of computational complexity.
For deep learning models, researchers have proceeded in three general directions: recurrent neural networks (RNNs), convolutional neural networks (CNNs), and attentional mechanisms [41,42].
A CNN is an image classification method that uses convolutional filters to extract image features. For text classification, text needs to be represented as a vector, similar to the image representation. Text features can then be filtered from multiple perspectives. The commonly used model is the TextCNN model, which was the first model introduced to solve the text classification problem [43]. Johnson et al. proposed a text classification CNN model based on two-view semi-supervised learning, which first uses unlabeled data to train the embedding of text regions and then uses labeled data [44]. This method has achieved good results in text classification. Since convolution requires many calculations, CNNs have begun to consider the allocation of computational resources, such as a deep pyramid convolutional neural network with a little more computational accuracy, which is increased by raising the network depth [45].
RNNs are widely used in text (emotion) recognition due to their ability to capture long-range dependencies through recursive computation. Different networks based on RNNs will have different effects on text (emotion) recognition. Many researchers are also refining their models to achieve the best recognition capability. Abdi et al. presented a deep-learning-based method, called RNSA; it employs an RNN that is composed of long short-term memory (LSTM) to take advantage of sequential processing and overcome several flaws in traditional methods, where order and information about a word are lost [46]. Wang et al. proposed a model for text classification called BiMPM, which encodes input sentences with a BiLSTM encoder. The encoded sentences are then matched in two directions, which brings improvement in accuracy [47].
In recent years, the attention mechanism has been continuously used to improve attention to different visual and textual information. In 2015, Bahdanaau et al. first proposed an attention mechanism that can be used for machine translation [48]. Thus, researchers started to explore text or emotion recognition based on attentional mechanisms. Considering the attention mechanism, Yang et al. introduced the hierarchical attention network to obtain better visualization by exploiting the highly informative components of text [49]. In the later proposed Transformer, the attention mechanism is continuously used to improve the attention of different visual information.
Through RNN and attention mechanisms, text classification algorithms can be adapted to emotion recognition by capturing the temporal relationships in sentences. However, text classification algorithms should be optimized for performance in emotion recognition. For text classification, the subject, predicate, object information, and time sequence relationship play the most important roles. For emotion recognition, adverbs and adjectives of different strengths are significant. Therefore, based on text classification algorithms, this paper refines the results by combining adjectives and adverbs in the emotion dictionary and proposes a loss mechanism with temporal information to improve the accuracy of emotion classification.

2.3. Research on the Spatial Environment

The built environment carries the activities of individuals, and unlike the natural environment, it includes land use, buildings, transportation, and landscape [50]. Built environment assessment originated from the investigation of satisfaction with the quality of the living environment. With the development of behavioral research, environmental assessment theory was gradually formed [51]. The evaluation elements of the built environment can be roughly divided into five aspects: social environment, land use, road traffic, eco-space, and public service, as shown in Table 1. Mao et al. used eight built environment elements based on streetscape maps to evaluate the street environment, which focused more on assessing the walkability of street spaces; indicators related to road traffic, including pavement, parking occupancy, accessibility, and pedestrian scale; indicators related to eco-space, including sightline and green landscapes [52]. Chen used seven elements to explore the emotional space and built environment in Nanjing, including traffic, residence, public service, etc.; these elements could also be divided into five aspects [53]. Lin et al. studied happiness and the built environment by using four aspects of the built environment: indicators related to the social environment, including population density, deviation index of employment, and residence; indicators related to road traffic, including buses available; indicators related to eco-space, including green rate; indicators related to public service, including diversity of public facilities [54]. Lu used four categories of built environment elements in the study of the emotional health of older environments: indicators related to social environment, including population density; indicators related to land use, including land type and plot ratio; indicators related to road traffic, including bus station density and street height to width ratio; indicators related to eco-space, including view rate and sky openness [55]. Xie et al. analyzed Shanghai’s built environment using three aspects: social environment indicators, including job–housing relationships; land use indicators, including land use intensity, spatial linkages, and nodes; road traffic indicators, including travel behavior [56].
Spatial elements are complex, and the built environment evaluation elements vary when the research aims are different. Different spatial scales, from urban areas to streets, can be used as units of study for the built environment, which can present different spatial characteristics. In accordance with previous studies and considering the availability of data, ten indicators were selected to assess the built environment of Shanghai in five aspects: land use degree, job–housing relationship, road traffic, green rate, and density of five service facilities.

3. Materials and Methods

3.1. Study Area and Data Sources

The research object was Shanghai, the national central city and a megacity in China. The study area covers 16 districts, with a total area of 6340.5 square kilometers. According to the United Nations World Health Organization’s criteria for age classification, people aged 15–45 are classified as youth. According to the age of Weibo users, the active users are mainly young people. Based on the Weibo data in Shanghai, this study analyzed the emotional characteristics of youth.
Between 19–25 July 2021, by filtering the residence address of users, this study used a Python crawler to obtain 15,675 Weibo comments from Shanghai youth residents. Each Weibo review mainly contained a user ID, posting time, the longitude and latitude of the check-in point, and the review itself (as shown in Table 2).
To ensure the validity of the data and improve the accuracy of sentiment recognition, the original data were screened before being processed. First, duplicate data were excluded; garbled texts caused by the failure of text language parsing were removed in the crawling process. Second, blank texts such as images and videos and advertisements without subjective opinions were removed. Finally, Weibo comments beyond the scope of Shanghai were deleted. While reviewing Weibo comments, pictures and videos could not be accessed due to platform limitations. They were displayed in text as “Weibo pictures” and “Weibo videos” and thus research considered them as meaningless. After this process, there were a total of 10,916 valid reviews. The spatial distribution of Weibo check-in points in Shanghai is shown in Figure 2. Correlating the number of Weibo comments in each district with the resident youth population, the results are highly significant, indicating that the one-week Weibo data used in the study can be a realistic reflection of public sentiment.

3.2. Text Sentiment Classification

3.2.1. Dataset for Training and Testing

The dataset used for algorithm training and testing was provided by the Social Computing and Information Retrieval Research Center of the Harbin Institute of Technology. The raw data originated from the Micro-Hotspot Big Data Research Institute of Sina Weibo. The dataset is divided into two parts. The first is the general Weibo dataset, which is randomly obtained Weibo content that is not specific to a particular topic and instead covers a wide range of topics. The second is the COVID-19 dataset, which is a collection of comments obtained during the epidemic period using relevant keyword filtering and whose content is related to COVID-19. Each comment was labeled as one of the following six sentiments: “Happy”, “Surprise”, “Neutral”, “Anger”, “Sad”, and “Fear”. This dataset consisted of 27,768 reviews.

3.2.2. Framework

The sentiment classification algorithm framework was applied to explore the relationship between youth sentiment and the built environment. To obtain the final output for further analysis, the raw text went through three stages: Baseline, Refinement, and Reanalysis. Due to difficulty in annotating the dataset, we could not obtain a more detailed sentiment classification from a Baseline model. In order to calculate sentiment intensity, feeding the sentiment label into the Reanalysis module was used to output the final intensity through some sample-free training methods. The overall algorithm framework is shown in Figure 3.

3.2.3. Pretrained Vocabulary Vector

One of the most important tasks in natural language and emotion recognition is the encoding of a character or word, which loses its contextual information in traditional one-shot encoding. From the classical 2-g to the n-gram, all aim to make the word vector more relevant to the contextual information. Word2vec is a normal tool for acquiring distributed word vectors. After large-scale pre-training of the data, a neural network consisting of a shallow hidden layer and softmax was constructed. Word2vec obtains more contextual information from word vectors, which is important for emotion-recognition tasks. Therefore, Word2vec was used to construct the word vectors in this study.

3.2.4. Baseline Module

Most natural language processing tasks are based on the Seq2seq model, which consists of two parts, the encoder and decoder. After the proposal of the Attention mechanism, the Seq2seq model with Attention was improved for each task. In this paper, the Baseline module of the sentiment recognition adopts the Seq2seq model based on Transformer, which consists of a stack of six encoder and decoder modules, as shown in Figure 4. The encoder module is mainly used to extract features from the word vectors, and the encoder module focuses more on the word-to-word (character-to-character) relationships. The decoder module is mainly used to recode the extracted features, which will make the different tasks more flexible.
“Encoder#1” is an encoder module that consists of a Multi-Head Attention layer and a Fully Connected Feed Forward Networks layer, for converting the input corpus into feature vectors. “Decoder#1” is a decoder module that consists of a Masked Multi-Head Attention layer, a Multi-Head Attention layer, and a Fully Connected Feed Forward Networks layer, for outputting the final probabilities of sentiment labels.

3.2.5. Refinement Module

  • Multi-Loss Constraint
The loss function is often used to describe the convergence of a model. This study built three transformer modules to obtain semantic information at different depths. The first transformer module obtains information about subject-verb-object, the second obtains information about the connection of subject-verb-object sequences, and the third obtains the meaning of words with depth. The shallow information of the first layer is then stitched into the deep information of the next two layers, as shown Figure 5, and both the latter two layers are passed through the loss constraint. With the multi-loss constraint, the model obtains better emotion capture. In general, this study aimed to design a parallel loss structure like RNN, which superimposes semantic information at the encoder layer. This structure improved the overall recognition of emotion by superimposing continuous semantics on the output feature map.
2.
Data Augmentation
When training a machine learning model, it is necessary to map an input of a picture or text to a corresponding output. The optimization goal pursues the optimal point of model loss. However, when tuning the model using the correct approach, it turns out that a model with higher prediction accuracy usually contains millions of floating-point parameters, and training these parameters often requires more samples to ensure correctness.
In order to increase the amount of data in the training sample, data augmentation must be used. This means data is augmented with a certain amount of extra data without concern for data annotation. This study used two data augmentation methods. The first is back translation (translating twice, e.g., Chinese to English and then English to Chinese), and the second is easy data augmentation: synonym replacement, insertion, exchange, and deletion. Data augmentation can improve the robustness of the model.

3.2.6. Reanalysis Module

In order to be able to describe sentiments in more detail, the Reanalysis Module calculates the sentiment intensity. In fact, for fine-grain evaluation, metrics need to be performed with a larger and more precise dataset. With the existing data, this study used the sentiment dictionary HowNet to extract adjectives and adverbs in comments for a more detailed analysis of sentiment. The reanalysis module is shown as Figure 6.
The module mainly consisted of a shallow deep learning network for regression and a fusion module incorporating a sentiment dictionary. By analyzing the adjectives and adverbs before and after the sentiment words in the text against the sentiment dictionary, the sentiment intensity of the text was determined. The adjectives and adverbs were encoded as word vectors, and the encoded information was fused into the final regression task to obtain the results.

3.3. Built Environment

Based on the previous review of international studies on the built environment, it was found that indicators for evaluating the built environment can be divided into five aspects; this study decided to select ten elements from these five aspects to evaluate the built environment according to the availability of data.

3.3.1. Land Use Degree

Land use is an important influencing factor of the built environment, which can reflect the spatial layout of urban functions, the diversity of land use in a particular range, and the level of economic development and irrationality in construction. In this study, land use degree, based on the entropy index, was used to measure the land use of each research unit in Shanghai, and the formula is as follows:
M i x U s e d = i = 1 N p i ln p i ln N
where p i is the ratio of the area of each type of land to the total area of the unit; N is the land type.

3.3.2. Job–Housing Relationship

Smartphones record the location trajectory of users at certain time intervals; from this, the residence and workplace of users can be identified. In this study, the distribution of the residential population and employment population of Shanghai youth was extracted from mobile phone signaling data to analyze the job–housing relationship. The job–housing index is important for evaluating whether the distribution of urban residential areas and jobs is reasonably allocated; it is an important element of the built environment. The job–housing index is expressed by the ratio of the youth resident population in each district to the employed youth population.

3.3.3. Road Traffic

Road traffic includes two built environment elements: density of road network and density of public transportation stations. Road network density measures the connectivity of the regional transportation network and reflects the convenience of transportation in the region, which is conducive to people’s travel activities. At the same time, the higher the road network density, the greater the traffic volume in the area. The density of road networks in this study was calculated as the ratio of the total length of the road network in the district to the area of the district. Public transportation stations include bus stations and subway stations, and this study used the ratio of the number of public transportation stations in the district to the area of the district to indicate the density of public transportation stations. This in turn was used to reflect the convenience of public transportation in the region.

3.3.4. Green Rate

Green space is not only an important place for public activities but also a major part of determining environment quality. The green rate is expressed as the ratio of the green space area in the district to the area of the district. The ratio of green space reflects the distribution of green space and the built environment.

3.3.5. Service Facilities

Five categories of public service facility were selected: shopping facilities, food services, entertainment facilities, medical services, and exercise facilities. The ratio of the number of shopping facilities, food services, entertainment facilities, medical services, and exercise facilities to the area of the district was used in the study.

4. Results

4.1. Text Sentiment Analysis

The results of sentiment classification were obtained after the Baseline Module and Refinement Module of Weibo texts. The accuracy of our model classification was compared with popular models, and the results are shown in Table 3.
The results of the sentiment classification distribution of the dataset are shown in Figure 7, and the detailed results for each district are shown in Table 4.
Based on Table 4, the number of texts labeled “Neutral” was the highest, accounting for about 37% of the total sample. Comments with “Neutral” labels do not have an emotional character. The number of texts labeled “Fear” was the lowest (only nine); thus, it is not representative of prominent sentiments. In subsequent studies, the other four sentiments will be focused on. In general, when only “Happy”, “Surprise”, “Sad”, and “Angry” were considered, Shanghai youth had 45% positive sentiments (“Happy” and “Surprise”) and 55% negative sentiments (“Sad” and “Angry”), with more negative sentiments than positive sentiments in the one week. From the results of each district, the district with the highest percentage of positive sentiment was Qingpu (about 52%), followed by Fengxian (about 50%), as shown in Figure 8. Qingpu, in recent years, has converged two national strategies: a demonstration green zone and integrated ecological development of the Yangtze River Delta and the Hongqiao International Hub. These strategies have allowed Qingpu to continue to upgrade its core urban functions and service quality. From the current results, only these two districts have a positive-polarity sentiment. Qingpu and Fengxian both belong to the construction area of “The Five New Cities in Shanghai”, which highlights the quality of space, in accordance with standards and levels applicable beyond the construction of the central city.
The “Happy” label accounted for the highest proportion of texts in Chongming, about 31%. Chongming is a very popular tourist destination in Shanghai, with a beautiful ecological environment and a higher sense of well-being. The “Sad” label accounted for the highest number of texts in Jinshan, about 28%, and it also was responsible for the highest proportion of negative sentiment. Jinshan is located in the southwest of Shanghai and is an industrial area. Although there are abundant land resources, its built environment is poor, and the construction of public service facilities needs to be improved.
The intensity of the five sentiments is shown in Table 5. There are five values of sentiment intensity: −2, −1, 0, 1, and 2. The value “2” indicates greater intensity and the value “−2” indicates less intensity. Taking the “Happy” sentiment as an example, “2” means very happy, and “−2” means happy. Overall, the intensity of all types of sentiment is mainly at a high level. The average intensity of “Happy” in each district is relatively similar; the average intensity of “Surprise” is significantly different, with the highest intensity in Songjiang (average intensity of 1.17) and the lowest in Chongming (average intensity of 0). “Anger” is the highest intensity among all types of sentiments, and the intensity of each district is relatively similar; the average intensity of “Sad” in each district is at a lower level. Districts with higher intensity of positive sentiments are usually accompanied by higher intensity of negative sentiments as well. In addition to the central area, “The Five New Cities” also have higher sentiment intensity. This result suggests that paying more attention to the spatial environment can enhance the positive emotions of youth.

4.2. Built Environment Analysis

Based on the current land use data in Shanghai in 2014, this study extracts five types of land use, including residential land, commercial land, industrial land, green land, and water area. When calculating the job–housing index for youth, the resident and employed populations of each unit in Shanghai were screened by mobile phone signaling data. The road network data used in this study are obtained from OpenStreetMap road data, which are divided into express roads and arterial roads, among which express roads include highways and urban expressways, and arterial roads include urban main roads and branch roads. For transport stations and services, we used the geocoding service based on Web API provided by the Baidu Map to extract Shanghai bus stops, subway stations, and five types of public service facility points.
The statistical results of all elements of the built environment are shown in Table 6. Land use degree varies by region. Pudong has the highest land use degree, while Huangpu has the lowest. Pudong is the largest district in Shanghai and also has the largest resident population. Pudong is a center of economy and technology, so it has a high land use degree. From the perspective of the job–housing relationship, Huangpu has a high job–housing relationship index, and as the core area of Shanghai, it has a high density of young people, but the distribution of jobs is low. Baoshan and Songjiang are the areas with the lowest job–housing relationship index, providing relatively more jobs for young people. Road traffic conditions are better in urban centers and worse in suburban areas. The green rate is higher in suburban areas and lower in urban centers; Chongming has a green rate of 62%. The distribution of daily service facilities is similar to road traffic and is mainly concentrated in Huangpu, Jingan, Changning, and other areas.

4.3. Correlation Analysis

The correlation analysis between the intensity of sentiment and the built environment was performed by SPSS at the scale of districts, and the results are shown in Table 7. Only the job–housing relationship index and green rate were significantly correlated with the intensity of “Surprise”.
At the scale of 500 m by 500 m, the correlation between sentiment intensity and built environment was also analyzed with SPSS, and the results are shown in Table 8. Land use degree and green rate were significantly correlated with the intensity of “Happy” and “Surprise”; road traffic, green rate, and service facilities were negatively correlated with the intensity of “Happy” and “Surprise.” Land use degree and green rate were negatively correlated with the intensity of “Sad”, “Neutral”, and “Angry”. The job–housing relationship, road traffic, and service facilities were significantly correlated with the intensity of “Sad” and “Neutral”; road traffic and service facilities were significantly correlated with the intensity of “Anger”. For land use degree, the larger the value, the greater the intensity of the “Happy” and “Surprise” sentiment. The greater the land use degree, the higher the diversity of facilities; the better the living environment, the more it can stimulate positive sentiment. For the job–housing relationship, the greater the value, the more residential the area and the lower the intensity of “Happy” and “Surprise”. For road traffic, road-network-dense areas with better accessibility stimulated the intensity of negative sentiments and reduced the intensity of positive sentiments. Regarding service facilities, the higher the density of service facilities in the area, the greater the intensity of negative sentiment, and the lesser the intensity of “Happy” and “Surprise”. Among all the built environment elements that had a high correlation with sentiment intensity of the youth, the density of food services had the greatest impact on all types of sentiment.
As the result, the built environment elements extracted from the scale of 500 m by 500 m are more correlated with sentiment intensity than district scale. This is because the scale of 500 m by 500 m more accurately reflects the actual range of individuals’ activities and more realistically reflects the built environment conditions that people are exposed to in their daily activities.

5. Discussion

To our knowledge, this is the first study to use Weibo comments in Shanghai to assess built environment quality and sentiment through a machine learning algorithm based on an attention mechanism. This study measured the sentiment characteristics of urban youth in Shanghai, reflecting on how the built environment affects sentiments on different scales. This study represents a critical first step in developing technology for harnessing social media data using a novel data source to monitor changes in public sentiment. Our findings indicate that social media data provide a more realistic picture of the sentiment characteristics of urban youth and that elements of the built environment at smaller scales have a significant effect on the intensity of all types of sentiments.
In terms of the spatial form of the city, land use degree should be appropriately increased, as land use degree is positively correlated with “Happy” and “Surprise” sentiments. Increasing land use degree can promote the expression of positive sentiments and reduce the proportion of negative sentiments. By observing land type in the study unit, it was found that commercial land was able to generate more positive sentiments. This indicates that the youth group is highly dependent on commercial facilities in their daily lives and that abundant resources of commercial facilities have a positive effect on the sentiments and well-being of youth. This can strengthen the mixed use of land, improve functional diversity, and increase the vitality of an area.
For the job–housing relationship, it is important to promote a balance of jobs and housing. The larger the job–housing relationship index is, the more separated jobs and housing are. Separation of jobs and housing will make the daily commute distance for youth longer, causing traffic congestion and waste of resources and therefore a higher intensity of the “Sad” sentiment. The job–housing relationship for youth can reflect the distribution pattern of youth commuting activities. The youth group is the main group of commuters, and if the job–housing relationship is improved, it will not only reduce the traffic congestion in the city, but also improve the employment attractiveness of the region. In areas where jobs are clustered, living areas and supporting living service facilities should be planned in order to better optimize spatial structure.
For road traffic, it is important to focus on the negative impacts of high accessibility because there is a high demand for traveling for urban youth. The higher the density of road networks and public transportation stations, the better the accessibility of the area and the more convenient it is for travel. However, high accessibility can cause problems such as excessive traffic, noise, and air pollution and can degrade environmental quality. Therefore, to avoid negative sentiment, it is important to pay attention to the quality of services and any traffic problems.
From the perspective of green space planning, the green rate of the central city should be increased. Many scholars have experimentally demonstrated that green natural resources can alleviate negative sentiments and enhance positive sentiments, and this is no exception for youth. The higher the green rate, the higher the intensity of positive sentiment. In urban planning, we should focus on the construction of various types of parks and green spaces and increase the density and coverage of green spaces to create positive emotional space.
For service facilities, attention needs to be paid to distribution. The distribution of service facilities is related to land use. Because of the high demand for food services among youth, the density of food services has a higher impact on sentiment intensity compared to other services. The layout of daily service facilities affects the basic quality of life of the youth; higher density of various types of service facilities, on the contrary, promotes negative sentiments. The layout of service facilities should avoid misallocation and waste of resources. At the same time, higher quality services should be provided to create a positive emotional environment.

6. Conclusions

Taking Shanghai as an example, this study explores the relationship between youth sentiment and the built environment by using attention-based machine learning methods. Shanghai is building a “Global City of Excellence”, and using it as an example can provide experience and recommendations for other metropolitan areas. According to this study, the sentiment of Shanghai youth tends to be negative, with a high percentage of “Sad” and “Anger” labels. Industrial areas with poorer built environments have a higher proportion of negative sentiments, while “The Five New Cities in Shanghai” have a higher proportion of positive sentiments. The sentiment intensity of Shanghai youth is at a higher level. Areas with higher intensity of positive sentiments are usually also accompanied by higher intensity of negative sentiments. At a smaller scale, built-environment elements have a significant effect on youth sentiments, and improving the built environment can promote positive sentiments and enhance the well-being of youth.

Author Contributions

Conceptualization, S.D. and Z.S.; data curation, S.D. and Z.S.; formal analysis, S.D. and Z.S.; investigation, S.D. and Z.S.; methodology, S.D. and Z.S.; software, S.D. and Z.S.; supervision, X.L.; validation, S.D. and Z.S.; visualization, S.D.; writing—original draft, S.D.; writing—review and editing, S.D., Z.S. and X.L. All authors have read and agreed to the published version of the manuscript.

Funding

National Natural Science Foundation of China (Grant/Award No. 51708414); National Natural Science Foundation of China (Grant/Award No. 72061137071); National Office for Philosophy and Social Sciences (Grant/Award No. 18CSH005); Natural Science Foundation of Shanghai (Grant/Award No. 21ZR1466600).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Veenstra, L.; Koole, S.L. Disarming darkness: Effects of ambient lighting on approach motivation and state anger among people with varying trait anger. J. Environ. Psychol. 2018, 60, 34–40. [Google Scholar] [CrossRef]
  2. Renz, T.; Leistner, P.; Liebl, A. Effects of the location of sound masking loudspeakers on cognitive performance in open-plan offices: Local sound masking is as efficient as conventional sound masking. Appl. Acoust. 2018, 139, 24–33. [Google Scholar] [CrossRef]
  3. Golder, S.A.; Macy, M.W. Diurnal and seasonal mood vary with work, sleep, and daylength across diverse cultures. Science 2011, 333, 1878–1881. [Google Scholar] [CrossRef] [Green Version]
  4. Davidson, J.; Milligan, C. Embodying Emotion Sensing Space: Introducing Emotional Geographies. Soc. Cult. Geogr. 2004, 5, 523–532. [Google Scholar] [CrossRef]
  5. Anderson, K.; Smith, S.J. Editorial: Emotional geographies. Trans. Inst. Br. Geogr. 2010, 26, 7–10. [Google Scholar] [CrossRef]
  6. Lin, Q. An Investigation of the Inclusion of Emotion in Media Geography. Master’s Thesis, Zhejiang University, Hangzhou, China, 2011. [Google Scholar]
  7. Wang, H.Q.; Chen, R.; Gui, L.; Fei, T. Mining emotional geography features based on Chinese Weibo data. Geomat. Info. Sci. Wuhan Univ. 2020, 45, 699–708. [Google Scholar]
  8. Wang, B.; Zhen, F.; Zhang, H. The dynamic changes of urban space-time activity and activity zoning based on check-in data in Sina Web. Prog. Geogr. 2015, 35, 151–160. [Google Scholar]
  9. Zhu, H.; Gao, Q. Review on “emotional turn” and emotional geographies in recent western geography. Geogr. Res. 2015, 34, 1394–1406. [Google Scholar]
  10. Jia, J.; Zhen, F.; Xi, G. A review on emotional geography: Its progress and enlightenment. World Reg. Stud. 2016, 25, 123–136. [Google Scholar]
  11. Dai, D.H.; Wang, Y.W.; Wang, Y.R.; Liu, S.N. Sentiment map construction based on semantic analysis of microblog data: A case study of Shenzhen city. In Proceedings of the 2021 China Urban Planning Annual Conference Proceedings, Chengdu, China, 25–30 September 2021; pp. 65–72. [Google Scholar] [CrossRef]
  12. Koenig, R.; Scheider, S.; Hamzi, I.; Bielik, M.; Schmitt, G.; Donath, D. Using geo statistical analysis to detect similarities in emotional responses if urban walkers to urban space. Proc. Natl. Acad. Sci. USA 2014, 98, 6911–6916. [Google Scholar]
  13. Chen, B.J.; Yan, T.H.; Chen, H.W. Evaluation of urban open space perception based on microblog data: A case study of Dangtu county. In Proceedings of the 2020 China Urban Planning Annual Conference Proceedings, Shenzhen, China, 5–13 December 2020; pp. 1171–1183. [Google Scholar] [CrossRef]
  14. Cui, L.M.; Qu, L.Y.; He, D. Evaluation of urban hot spot spatial emotion perception based on deep learning: A case study of Shanghai. Hum. Geogr. 2021, 36, 121–130. [Google Scholar]
  15. Cranshaw, J.; Schwartz, R.; Hong, J.; Sadeh, N. The Livehoods Project: Utilizing Social Media to Understand the Dynamics of a City; Social Science Electronic Publishing: New York, NY, USA, 2012. [Google Scholar]
  16. Rahim, A.I.A.; Ibrahim, M.I.; Musa, K.I.; Chua, S.-L.; Yaacob, N.M. Assessing Patient-Perceived Hospital Service Quality and Sentiment in Malaysian Public Hospitals Using Machine Learning and Facebook Reviews. Int. J. Environ. Res. Public Health 2021, 18, 9912. [Google Scholar] [CrossRef]
  17. Hannah, V.; William, O. Listen to the guests: Text-mining Airbnb reviews to explore indoor environmental quality. Build. Environ. 2020, 169, 106555. [Google Scholar]
  18. Chen, Y. Research on the Influence of Material Environment Perception on Walking Happiness in Harbin City. Master’s Thesis, Harbin Institute of Technology, Harbin, China, 2020. [Google Scholar]
  19. Hulliyah, K.; Awang, N.S.; Bakar, A.; Ismail, A.R. Emotion recognition and brain mapping for sentiment analysis: A review. In Proceedings of the 2017 Second International Conference on Informatics and Computing (ICIC), Jayapura, Indonesia, 1–3 November 2017; pp. 1–5. [Google Scholar]
  20. Xu, G.; Yu, Z.; Yao, H.; Li, F.; Meng, Y.; Wu, X. Chinese Text Sentiment Analysis Based on Extended Sentiment Dictionary. IEEE Access 2019, 7, 43749–43762. [Google Scholar] [CrossRef]
  21. Pan, Y.; Liang, M. Chinese Text Sentiment Analysis Based on BI-GRU and Self-attention. In Proceedings of the 2020 IEEE 4th Information Technology, Networking, Electronic and Automation Control Conference (ITNEC), Chongqing, China, 12–14 June 2020; pp. 1983–1988. [Google Scholar]
  22. Dey, A.; Jenamani, M.; Thakkar, J.J. Sentiment Weight of N-grams in Dataset (SEND): A Feature-set for Cross-domain Sentiment Classification. In Proceedings of the 2017 Ninth International Conference on Advances in Pattern Recognition (ICAPR), Bangalore, India, 27–30 December 2017; pp. 1–6. [Google Scholar]
  23. Hong, W.; Min, L. A review: Text sentiment analysis methods. Comput. Eng. Sci. 2019, 41, 750–757. [Google Scholar]
  24. Dong, Z.; Dong, Q. Hownet-a hybrid language and knowledge resource. In Proceedings of the Natural Language Processing and Knowledge Engineering, Beijing, China, 26–29 October 2003; pp. 820–824. [Google Scholar]
  25. NTUSD. Chinese Emotion Words Dictionary [EB/OL]. Available online: https://download.csdn.net/download/zhangyinhua1122/11233148 (accessed on 10 January 2022).
  26. Esuli, A.; Sebastiani, F. Sentiwordnet: A publicly available lexical mining. Proc. Resour. Opin. LREC 2006, 6, 417–422. [Google Scholar]
  27. Sampson, G. Christiane Fellbaum (ed.), Wordnet: An electronic lexical database. Int. J. Lexicogr. 2000, 13, 54–58. [Google Scholar] [CrossRef]
  28. Turney, P.D. Thumbs up or thumbs down? In Semantic orientation applied to unsupervised classification of reviews. In Proceedings of the Annual Meeting of the Association for Computational Linguistics, Philadelphia, PA, USA, 6–12 July 2002; pp. 417–424. [Google Scholar]
  29. Xiao, C.; Shi, S.; Lin, P.X. An analysis of community emergency projects’ implementation for public health emergencies based on social media public sentiment. J. Tongji Univ. 2021, 32, 114–124. [Google Scholar]
  30. Zhu, H.H.; Yu, Q.S. Study on the extraction of Chinese microblog subjective sentences based on lexicon and corpus. J. East China Norm. Univ. 2014, 2014, 62. [Google Scholar]
  31. Song, X.Y.; Zhao, Y.; Jin, L.-T.; Sun, Y.; Liu, T. Research on the construction of sentiment dictionary based on Word2vec. In Proceedings of the 2018 International Conference, Mexico City, Mexico, 19–20 July 2018. [Google Scholar]
  32. Tan, F.C. The Chinese microblog emotional tendency analysis based on sentiment dictionary. Appl. Mech. Mater. 2013, 333, 795–798. [Google Scholar] [CrossRef]
  33. Bai, X.; Chen, F.; Zhan, S.B. A study on sentiment computing and classification of Sina Weibo with Word2vec. In Proceedings of the 2014 IEEE International Congress on Big Data, Anchorage, AK, USA, 27 June–2 July 2014; pp. 358–363. [Google Scholar]
  34. Meral, M.; Diri, B. Sentiment analysis on Twitter. In Proceedings of the IEEE 2014 22nd Signal Processing and Communications Applications Conference (SIU), Trabzon, Turkey, 23–25 April 2014; pp. 690–693. [Google Scholar]
  35. Mohammad, S.M.; Zhu, X.; Mohammad, S. Sentiment analysis of short informal text. J. Artif. Intell. Res. 2014, 50, 723–762. [Google Scholar]
  36. Hanx, H.; Wang, J.L.; Zhang, M.; Wang, X. Using social media to mine and analyze public opinion related to COVID-19 in China. Int. J. Environ. Res. Public Health 2020, 17, 2788. [Google Scholar]
  37. Cheng, L.C.; Tsai, S.L. Deep Learning for Automated Sentiment Analysis of Social Media. In Proceedings of the 2019 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), Vancouver, BC, Canada, 27–30 August 2019; pp. 1001–1004. [Google Scholar]
  38. Wang, Z.; Liu, J.; Sun, G.; Zhao, J.; Ding, Z.; Guan, X. An Ensemble Classification Algorithm for Text Data Stream based on Feature Selection and Topic Model. In Proceedings of the 2020 IEEE International Conference on Artificial Intelligence and Computer Applications (ICAICA), Dalian, China, 27–29 June 2020; pp. 1377–1380. [Google Scholar]
  39. Minaee, S.; Kalchbrenner, N.; Cambria, E.; Nikzad, N.; Chenaghlu, M.; Gao, J. Deep Learning Based Text Classification: A Comprehensive Review. arXiv 2020, arXiv:2004.03705. [Google Scholar] [CrossRef]
  40. Dol, M.; Geetha, A. A Learning Transition from Machine Learning to Deep Learning: A Survey. In Proceedings of the 2021 International Conference on Emerging Techniques in Computational Intelligence (ICETCI), Hyderabad, India, 25–27 August 2021; pp. 89–94. [Google Scholar]
  41. Tai, K.S.; Socher, R.; Manning, C.D. Improved semantic representations from tree-structured long short-term memory networks. arXiv 2015, arXiv:1503.00075. [Google Scholar]
  42. Zhu, X.; Sobihani, P.; Guo, H. Long short-term memory over recursive structures. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 July 2015; pp. 1604–1612. [Google Scholar]
  43. Kim, Y. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, 25–29 October 2014; pp. 1746–1751. [Google Scholar]
  44. Johnson, R.; Zhang, T. Semi-supervised convolutional neural networks for text categorization via region embedding. Adv. Neural Inf. Process. Syst. 2015, 28, 919–927. [Google Scholar]
  45. He, K.; Zhang, X.; Ren, S.; Sun, J. Identity mappings in deep residual networks. In Proceedings of the ECCV, Amsterdam, The Netherlands, 8–16 October 2016; pp. 630–645. [Google Scholar]
  46. Abdi, A.; Shamsuddin, S.M.; Hasan, S.; Piran, J. Deep learning-based sentiment classification of evaluative text based on Multi-feature fusion. Info. Pro. Manag. 2019, 56, 1245–1259. [Google Scholar] [CrossRef]
  47. Wang, Z.; Hamza, W.; Florian, R. Bilateral multi-perspective matching for natural language sentences. In Proceedings of the IJCAI, Melbourne, Australia, 19–25 August 2017; pp. 4144–4150. [Google Scholar]
  48. Bahdanau, D.; Cho, K.; Bengio, Y. Neural machine translation by jointly learning to align and translate. International Conference on Learning Representations (ICLR), San Diego, CA, USA,, 7–9 May 2015. [Google Scholar]
  49. Yang, Z.; Yang, D.; Dyer, C.; He, X.; Smola, A.; Hovy, E. Hierarchical attention networks for document classification. In Proceedings of the NAACL, San Diego, CA, USA, 12–17 June 2016; pp. 1480–1489. [Google Scholar]
  50. Bronfenbrenner, N. The Ecology of Human Development: Experiments by Nature and Design; Harvard University Press: Cambridge, MA, USA, 1979; p. 26. [Google Scholar]
  51. Yang, G.X. Theoretical models and research methods of environmental psychology. Architect 1999, 55, 23–25. [Google Scholar]
  52. Mao, M.R.; Chu, Y.; Chen, H.; Yu, W.C. Practice of public participation in Internet planning. In Proceedings of the 2015 China Urban Planning Annual Conference Proceedings, Suzhou, China, 25–26 June 2015; pp. 19–34. [Google Scholar]
  53. Chen, Y.X. A Preliminary Study on the Relationship between Residents’ Emotion and Built Environment and Its Planning Application. Master’s Thesis, Nanjing University, Nanjing, China, 2015. [Google Scholar]
  54. Lin, J.; Sun, B.D. The influence of built Environment on subjective well-being of Urban residents: Evidence from the Labor Dynamics Survey in China. Urban Dev. Res. 2017, 24, 69–75. [Google Scholar]
  55. Lv, F.; Han, B.B.; Wang, B. Study on the influence of built environment on the emotional health of the elderly in cold area based on principal component analysis. Urban Archit. 2018, 24, 47–50. [Google Scholar]
  56. Xie, D.C.; Wang, D.; Zhong, W.J.; Yan, L.X. Evaluation and analysis of Built environment in Shanghai—Exploration based on mobile signaling data. Urban Plan. 2018, 42, 97–108. [Google Scholar]
  57. Xu, X.Q.; Liu, S.S. Study on soundscape and Emotion Perception in built Environment: Taking classical garden as an example. Time Archit. 2020, 5, 42–46. [Google Scholar]
  58. Long, Y.; Li, L.; Li, S.J.; Chen, L.; Pan, Z.M.; Yao, Y.T.; Chen, M.; Wang, Y.L.; Quan, J.; Zhang, L.X.; et al. Measurement of street walking environment index in vitality Center of Chinatown. South Archit. 2021, 1, 114–120. [Google Scholar]
  59. Leslie, E.; Cerin, E. Are perceptions of the local environment related to neighborhood satisfaction and mental health in adults? Prev. Med. 2008, 47, 273–278. [Google Scholar] [CrossRef]
  60. Ettema, D.; Schekkerman, M. How do spatial characteristics influence well-being and mental health? Comparing the effect of objective and subjective characteristics at different spatial scales. Travel Behav. Soc. 2015, 5, 56–67. [Google Scholar] [CrossRef]
  61. Ewing, R.; Cervero, R. Travel and the Built Environment: A Meta-analysis. J. Am. Plan. Assoc. 2010, 76, 265–294. [Google Scholar] [CrossRef]
  62. Yuan, Y. The Influence of Built Environment on the Distribution of Adult Outdoor Slow Physical Activity in Shenzhen. Master’s Thesis, Nanjing Normal University, Nanjing, China, 2017. [Google Scholar]
  63. Wang, X.; Jiao, J. A review of studies on built environment based on learning travel. Int. Urban Plan. 2018, 33, 57–62. [Google Scholar] [CrossRef]
  64. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. Adv. Neural Inf. Process. Syst. 2017, 30, 5998–6008. [Google Scholar]
Figure 1. Age distribution of Weibo users.
Figure 1. Age distribution of Weibo users.
Ijerph 19 04794 g001
Figure 2. Distribution of Weibo check-in points in Shanghai.
Figure 2. Distribution of Weibo check-in points in Shanghai.
Ijerph 19 04794 g002
Figure 3. The sentiment classification algorithm framework.
Figure 3. The sentiment classification algorithm framework.
Ijerph 19 04794 g003
Figure 4. Baseline module [64].
Figure 4. Baseline module [64].
Ijerph 19 04794 g004
Figure 5. Multi-loss constraint framework.
Figure 5. Multi-loss constraint framework.
Ijerph 19 04794 g005
Figure 6. Reanalysis module.
Figure 6. Reanalysis module.
Ijerph 19 04794 g006
Figure 7. Sentiment classification distribution.
Figure 7. Sentiment classification distribution.
Ijerph 19 04794 g007
Figure 8. Proportion of positive sentiment.
Figure 8. Proportion of positive sentiment.
Ijerph 19 04794 g008
Table 1. Summary of previous studies.
Table 1. Summary of previous studies.
ResearchersBuilt Environment Evaluation Elements
Social Env.Land UseRoad TrafficEco-SpacePublic Service
Lin et al. [54]Population density, Deviation index of employment and residence Buses availableGreen rateDiversity of public facilities
Lv et al. [55]Population densityUrban spatial structureBus station density, Street height to width ratioGreen view rate
Sky openness
Xie et al. [56]Job–housing relationshipLand use intensityResidents’ travel behavior
Xu et al. [57] Soundscape
Long et al. [58] Street crossing facilities, Motor vehicle and non-motor vehicle isolation, Walkway widthStreet greeningStreet facilities
Leslie [59] Land useTraffic safety, Street connectivity, Traffic flowGreen rateInfrastructure
Ettema [60]Attractiveness Accessibility, Traffic safety Facilities
Ewing [61] Land useAccessibilityGreen rate
Yuan [62]Population densityLand use degree, Land type, Residential land ratioBus station density, Density of road network, Intersection densityGreen rate
Wang et al. [63] Land use degreeDensity of road network, Buses available Density of public service
Table 2. Example of Weibo comments.
Table 2. Example of Weibo comments.
IDTimeLongitudeLatitudeWeibo Comments
119 July
13:43:43
121.486131.23672Chinese Comments: ‘好久不更博,最近把微博给忘了’.
English Comments: ‘I forgot about Weibo recently, it’s been a while since I updated’.
219 July
17:21:14
121.442231.22382Chinese Comments: ‘失踪人口回归’.
English Comments: ‘Return of missing persons’.
319 July
00:18:53
121.444631.22577Chinese Comments: ‘吃六个带两个回家,上海限定豫园奶昔也太好喝’.
English Comments: ‘Eat six and take two home, Shanghai limited Yuyuan milkshakes are too good’.
Table 3. Model evaluation of sentiment analysis.
Table 3. Model evaluation of sentiment analysis.
MethodScore (Acc %)
FastText0.639
TextCNN0.657
TextRCNN0.645
Transformer0.650
Ours0.697
Table 4. Results of sentiment classification.
Table 4. Results of sentiment classification.
DistrictSentiment Label
HappySurpriseNeutralAngrySadFearTotal
Huangpu3803264918230101544
Yangpu841214562830386
Hongkou77813741700333
Jingan222132921071550789
Putuo107313667831397
Changning1319166581130477
Xuhui245143141341672876
Chongming221251410072
Fengxian5446727310183
Qingpu154825264850563
Songjiang1546200941311586
Jinshan2913423330120
Pudong6844890037051642522
Jiading1318131741111456
Baoshan12210133801080453
Minhang3102241915225601159
Total2906199400015492253910,916
Table 5. Sentiment intensity.
Table 5. Sentiment intensity.
DistrictHappySurpriseAngrySad
MeanSDMeanSDMeanSDMeanSD
Huangpu0.780.45−0.090.901.190.97−0.580.90
Yangpu0.710.44−0.170.311.060.90−0.640.74
Hongkou0.780.51−0.380.231.270.73−0.611.09
Jingan0.700.52−0.350.401.240.80−0.540.93
Putuo0.710.391.000.671.060.83−0.450.92
Changning0.710.43−0.110.771.100.85−0.550.96
Xuhui0.740.43−0.070.781.150.87−0.521.02
Minhang0.660.530.090.721.330.88−0.670.89
Fengxian0.800.64−0.500.251.190.97−0.770.50
Qingpu0.750.43−0.130.611.090.99−0.421.16
Songjiang0.690.541.170.471.350.55−0.730.86
Jinshan0.720.481.000.001.260.63−0.331.19
Pudong0.690.54−0.310.671.190.81−0.650.87
Jiading0.770.50−0.500.501.050.92−0.461.08
Baoshan0.810.46−0.100.091.140.82−0.650.86
Chongming0.730.380.000.000.931.07−0.301.01
Table 6. Built environment elements.
Table 6. Built environment elements.
DistrictLand Use DegreeJob–Housing RelationshipRoad Network (km/km2)Transportation StationGreen RateShopping FacilitiesFood ServicesEntertainment FacilitiesMedical ServicesExercise Facilities
Huangpu0.521.3217.861.320.14694.03230.729.744.8525.85
Yangpu0.650.5613.770.450.11207.4999.5614.0223.2911.69
Hongkou0.530.6717.050.770.1362.5315920.3439.3620.08
Jingan0.671.0116.550.710.12508.99183.5721.0940.1921.28
Putuo0.710.6115.760.40.24243.6996.3713.1220.8512.31
Changning0.680.9016.810.480.31248.88122.4416.6432.0717.26
Xuhui0.631.0716.270.630.22232.15114.8414.7924.817.09
Minhang0.740.516.730.270.2166.0631.014.364.653.53
Fengxian0.760.373.940.150.4721.16.251.111.380.47
Qingpu0.740.403.880.150.4119.156.770.761.150.54
Songjiang0.740.355.150.170.4230.3613.942.052.031.22
Jinshan0.640.434.040.210.5415.284.740.861.10.35
Pudong0.840.536.080.180.3144.3518.492.373.462.05
Jiading0.770.415.80.130.3341.4916.151.952.741.32
Baoshan0.780.306.670.130.5572.4627.93.84.692.64
Chongming0.770.412.90.130.624.040.780.490.340.1
Table 7. Correlation between public sentiment intensity and built environment (scale: district).
Table 7. Correlation between public sentiment intensity and built environment (scale: district).
Built EnvironmentHappySurpriseAngrySad
Land Use Degree0.207−0.1430.132−0.238
Job–housing0.261−0.590 *−0.106−0.135
Road Network−0.2920.462−0.0360.016
Transportation−0.1680.4360.0610.042
Green Rate−0.013−0.559 *0.030.051
Shopping Facilities−0.1620.4020.055−0.003
Food Services−0.1980.4130.0240.013
Entertainment−0.2250.4240.033−0.003
Medical Services−0.2050.37−0.0030.034
Exercise Facilities−0.2340.4360.0160.04
* Significant at the 0.05 level.
Table 8. Correlation between public sentiment intensity and built environment (scale: 500 m × 500 m).
Table 8. Correlation between public sentiment intensity and built environment (scale: 500 m × 500 m).
Built EnvironmentHappySurpriseAngrySad
Land Use Degree0.014 *0.076 **−0.034 **−0.052 **
Job–housing−0.003−0.0120.0070.021 **
Road Network−0.044 **−0.212 **0.102 **0.166 **
Transportation−0.003−0.103 **0.034 **0.074 **
Green Rate0.018 **0.161 **−0.078 **−0.131 **
Shopping Facilities−0.052 **−0.217 **0.090 **0.150 **
Food Services−0.080 **−0.282 **0.107 **0.221 **
Entertainment−0.064 **−0.242 **0.106 **0.194 **
Medical Services−0.071 **−0.197 **0.085 **0.150 **
Exercise Facilities−0.053 **−0.268 **0.117 **0.205 **
** Significant at the 0.01 level, * significant at the 0.05 level.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Duan, S.; Shen, Z.; Luo, X. Exploring the Relationship between Urban Youth Sentiment and the Built Environment Using Machine Learning and Weibo Comments. Int. J. Environ. Res. Public Health 2022, 19, 4794. https://doi.org/10.3390/ijerph19084794

AMA Style

Duan S, Shen Z, Luo X. Exploring the Relationship between Urban Youth Sentiment and the Built Environment Using Machine Learning and Weibo Comments. International Journal of Environmental Research and Public Health. 2022; 19(8):4794. https://doi.org/10.3390/ijerph19084794

Chicago/Turabian Style

Duan, Sutian, Zhiyong Shen, and Xiao Luo. 2022. "Exploring the Relationship between Urban Youth Sentiment and the Built Environment Using Machine Learning and Weibo Comments" International Journal of Environmental Research and Public Health 19, no. 8: 4794. https://doi.org/10.3390/ijerph19084794

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop