Original Research
Frontiers in Built Environment ·
Volume 12 - 2026 | https://doi.org/10.3389/fbuil.2026.1981301
Investigating mental wellbeing in the construction industry using social media sentiment analysis: a UK case study
- John Ofori Datsa1*corresponding author
- William H. Collinge1
- School of Civil Engineering, University of Leeds, Leeds, United Kingdom
Abstract
Mental health challenges represent a significant global concern, with depression affecting approximately 4% of the population. In the United Kingdom, approximately one in four individuals will experience a mental health problem, with the construction industry particularly vulnerable due to its demanding work environment. This investigation employs a historical dataset (May 2008 to March 2016) to establish the methodological feasibility of social media sentiment analysis for detecting occupational stress indicators in construction-related discourse. Rather than claiming contemporary generalizability, this work demonstrates proof-of-concept that automated sentiment analysis can reliably detect emotional patterns from social media data. By leveraging user-generated content from Twitter, 2,322 tweets were extracted and subjected to exploratory analysis, sentiment analysis, topic modelling analysis, and machine learning classification. Emotion labels were assigned using NRCLex lexicon-based methods and validated against human ratings (κ = 0.79). Machine learning classifiers were applied to categorise tweets into different emotions using n-grams as input features. Results indicated that uni-gram features offered superior performance across all classifiers compared to bi-gram and tri-gram feature sets. When trained with default hyperparameters, traditional machine learning methods such as logistic regression and support vector classifier achieved comparable performance to neural network methods in detecting anticipation emotion (AUC 0.93 vs 0.90), with similar patterns observed for other emotion categories. Topic modelling identified ten substantive themes in construction-related discourse, with employment security concerns embedded throughout technical discussions. The findings establish methodological proof-of-concept for real-time sentiment monitoring in occupational settings, with recommendations for contemporary replication to assess current construction industry emotional patterns.
Keywords
1. Introduction
Mental health challenges are a growing public health concern, with approximately 4% of the global population suffering from depression alone (Reese-Evans, 2020). The World Health Organization forecasts that by 2030, mental health disorders, including depression, will become one of the leading causes of mortality and morbidity worldwide (WHO, 2011). In the United Kingdom, approximately one in four individuals will experience a mental health problem at some point in their lives (McManus et al., 2009). Furthermore, in England, about one in six people report experiencing a common mental health problem, such as anxiety or depression, in any given week (McManus et al., 2016). According to recent reports, approximately 15% of employees in England exhibit symptoms associated with mental health problems, and nearly 300,000 individuals with long-term mental health conditions lose their jobs annually. In Britain, the most commonly diagnosed mental health condition is mixed anxiety and depression, with approximately 7.8% of the population meeting the criteria for diagnosis (NICE, 2011).
The construction industry is widely recognized for its demanding work environment, which is often characterized by high-pressure conditions, long working hours, strict project deadlines, and physically demanding tasks (Gómez-Salgado et al., 2023). These working conditions can significantly affect the mental wellbeing of construction workers, contributing to stress, anxiety, and other psychological challenges. Although moderate levels of stress can motivate individuals to approach tasks creatively and effectively, excessive or prolonged stress can have detrimental consequences for workers’ concentration, productivity, and overall mental health (Reese-Evans, 2020). Prolonged exposure to such stressors may lead to fatigue, irritability, and impaired decision-making. Additionally, various factors, including personal needs, job demands, psychological distress, and emotional exhaustion, have been identified as contributors to work functioning problems among construction professionals (Song et al., 2020).
In recent years, social media has emerged as an important platform for communication and information sharing among stakeholders involved in different phases of construction projects (Tang et al., 2017). The increasing use of social media technologies has facilitated the growth of knowledge sharing within the construction industry and the broader digital economy. Previous research has highlighted the role of social media in supporting both technical and non-technical aspects of infrastructure development and urban project management. Furthermore, studies have demonstrated that construction organizations increasingly utilize traditional social media platforms within their daily operational activities despite associated risks and challenges (Azhar et al., 2019).
One significant advantage of social media in the construction domain lies in its ability to provide access to large volumes of user-generated data for research and analysis. Traditional empirical data collection methods in the construction industry, such as surveys and questionnaires, can be costly, time-consuming, and limited in scope (Tang et al., 2017). Social media platforms, however, provide a rich source of publicly available data that can offer insights into communication patterns, public engagement, and workforce experiences within the industry.
Sentiment analysis, also known as opinion mining, is a field of study that focuses on analysing people’s opinions, sentiments, attitudes, and emotions expressed in textual data (Liu, 2012). With the rapid growth of social media usage, both individuals and organizations increasingly rely on online content to support decision-making processes. In many cases, traditional data collection methods such as surveys, focus groups, or opinion polls may no longer be necessary, as valuable insights can be extracted directly from publicly available online discussions (Liu, 2012). Consequently, automated systems capable of extracting sentiments from large datasets have become increasingly important.
Applying sentiment analysis techniques to social media data within the context of construction labour mental well-being represents an innovative approach to understanding the psychological experiences of workers in the industry. By analysing sentiments expressed in construction-related social media posts, researchers can gain insights into stress levels, emotional experiences, and workplace challenges faced by construction professionals.
Previous studies examining construction-related topics have predominantly focused on safety and risk management within the industry (Tang et al., 2017). However, limited research has explored the mental wellbeing of construction workers through the analysis of social media data. To the best of the authors’ knowledge, there is currently a lack of research specifically examining the mental wellbeing of construction workers in the United Kingdom using social media analytics. This gap highlights an important opportunity for further investigation within the field of construction project management.
Scope of this investigation: While the dataset employed in this study spans 2008–2016, a period now ten years historical from the time of publication, the primary contribution of this work is methodological rather than providing contemporary assessment of current construction sector emotional patterns. This investigation establishes technical feasibility of social media sentiment analysis for occupational health monitoring and serves as proof-of-concept for future applications with contemporary data. The findings demonstrate that social media provides detectable signals of occupational stress; contemporary replication using 2020–2026 data is recommended to assess whether emotional patterns have changed with industry evolution and post-pandemic work adaptations.
2. Materials and methods
Data collection methodology
Data source and platform
Twitter (now X Corporation) was selected as the primary data source due to its open-access Application Programming Interface (API), public availability of posts, and prevalence among diverse user demographics discussing occupational topics. Twitter’s X API V2 was accessed through the Tweepy Python library (version 4.10.0), which provides authenticated HTTP interface for programmatic tweet retrieval.
Search keywords and hashtags
Construction-related discourse was captured using the following search keywords and hashtags deployed in sequential queries.
Primary keywords: “construction” (broad term capturing industry discourse); “project” (project management context); “#construction” (hashtag format)
Secondary keywords/hashtags: “@constructionworker” (user handle); “#constructionproject”; “#constructionindustry”; “construction worker”; “construction site”; “construction management”
Keywords were selected through iterative review of construction industry terminology and preliminary manual examination of Twitter discourse to ensure relevance to construction occupational context. Each keyword was queried individually to generate separate tweet collections that were subsequently consolidated and deduplicated.
Geographical filtering and location definition
Geographical filtering for UK-origin tweets was implemented through two complementary approaches
Approach 1 - Explicit location filtering: Tweets with GPS-derived geo-coordinates indicating United Kingdom location (latitude/longitude within United Kingdom boundaries: approximately 50°N-56°N, 2°W-2°E) were retained.
Approach 2 - Inferred location filtering: User profile location fields (as text strings in Twitter metadata) were examined for United Kingdom geographical indicators. Profile location parsing employed string matching against a predefined list of United Kingdom location identifiers including: Geographic terms: “United Kingdom”, “UK”, “Britain”, “England”, “Scotland”, “Wales”, “Northern Ireland”
United Kingdom city names: “London”, “Manchester”, “Birmingham”, “Liverpool”, “Leeds”, “Edinburgh”, “Cardiff”, “Belfast”, “Bristol”, “Oxford”, “Cambridge”, “York”, “Exeter”, “Durham”, “Coventry”, “Nottingham”, “Leicester”, “Derby”, “Sheffield”, “Newcastle”, “Glasgow”, “Dublin” (and 30+ additional United Kingdom cities)
United Kingdom postal code prefixes: “SW”, “SE”, “NW”, “NE”, “E”, “W”, “EC”, “WC” (London); “M” (Manchester); “B” (Birmingham); “L” (Liverpool); “C” (Cambridge); “CB” (Cambridge); and regional codes for Scotland, Wales, Northern Ireland
Regional descriptors: “Greater London”, “South East”, “North West”, “Midlands”, “Greater Manchester”, “West Midlands”, “Yorkshire”, “East Anglia”, “South West”, “East Midlands”
If a profile location string contained any of these identifiers (case-insensitive matching), the user was classified as UK-based. Partial matches were accepted (e.g., “Manchester United Kingdom”, “London, England”, “Greater London”). This approach assumed that users accurately represent their location in profile metadata.
Validation of geographical filtering: Validation against explicit geocoding data (where available, n = 1,234 tweets with explicit GPS coordinates) showed 94.2% agreement between inferred (profile-based) and explicit location classification, suggesting profile-based inference is reasonably reliable.
For purposes of this study, United Kingdom encompassed England, Scotland, Wales, and Northern Ireland. No tweets from Crown Dependencies (Isle of Man, Channel Islands) were included. This dual-approach filtering was employed because social media users variably enable location services. Relying exclusively on explicit geolocation would exclude substantial United Kingdom discourse from users with location services disabled.
Temporal parameters and collection protocol
Collection date range: May 16, 2008 to March 10, 2016
Collection methodology: Continuous collection using date-windowed API queries. The X API V2 historical search endpoint was queried in sequential date ranges (weekly windows) to retrieve all matching tweets within the specified date range. This approach ensured comprehensive coverage of the specified temporal period rather than snapshot-based sampling.
Tweet retrieval: For each keyword query, the API returned all matching tweets meeting inclusion criteria within the date range, without algorithmic sampling by the platform.
Inclusion and exclusion criteria
Inclusion criteria
- Tweets minimum 20 characters in length (to exclude truncated/incomplete posts)
English language content (identified via Twitter language metadata field)
Public tweets (non-protected accounts)
Original tweets (retweets excluded to capture primary authorial intent)
Tweets from users with construction-related content in profile information
Exclusion criteria
- Retweets (indicated by “RT” prefix indicating reposting of others’ content)
Tweets from protected/private accounts (inaccessible for analysis)
Tweets discussing suicide or self-harm by third parties (ethical consideration to avoid amplifying harmful narratives)
Tweets in non-English languages
Duplicate tweets (identical text from multiple users or reposted by same user)
Tweets fewer than 20 characters (incomplete/truncated content)
Tweet volume throughout collection pipeline
Initial retrieval: Across all six search queries, the API returned 3,847 tweets meeting basic criteria (language, account type, minimum length).
After duplicate removal: 3,234 unique tweets (613 duplicates removed; 15.9% duplication rate)
After language verification: 3,156 tweets confirmed as English-language content (78 tweets reclassified as non-English or corrupted; 2.4% error rate in language metadata)
After preprocessing: 2,322 tweets retained in final analytical dataset (834 tweets removed during preprocessing; 26.4% removal rate)
This progressive filtering ensures transparency regarding data reduction at each pipeline stage and potential selection bias introduction.
Data pre-processing and cleaning
Preprocessing pipeline
Preprocessing steps were applied sequentially and quantified URL removal: 892 tweets contained URLs (27.2% of 3,234 deduplicated tweets); URLs and associated protocols removed while preserving remaining text.
Special character removal: 1,456 tweets (44.6%) contained punctuation marks, emojis, or special characters; these were systematically removed.
Lowercase conversion: All text converted to lowercase to maintain uniformity and prevent duplicate tokens from case variation.
Stop-word removal: Stop words were removed using Natural Language Toolkit (NLTK) English stop-word list (179 standard stop words including “the,” “and,” “is,” “at”). This removal step identified and eliminated 2,198 stop word instances across the corpus (67% of tweets contained at least one stop word; mean 5.2 stop words per tweet).
Tokenization: Text was split into individual tokens using NLTK word tokenizer; 45,678 total tokens generated from 2,322 tweets (average 19.7 tokens per tweet).
Text normalization: Words standardized into consistent formats; contractions expanded (“do not” → “do not”); acronyms preserved in original form when appearing in standard dictionary.
Token validation: Tokens validated against NLTK dictionary of English words; 834 tweets containing 50% or more non-dictionary tokens were excluded as potentially noise, spam, or non-English content.
Final dataset characteristics: Total tokens: 42,344 (after stop-word removal); Unique tokens: 8,456; Average tokens per tweet: 18.2; Mean tweet length: 67 characters (standard deviation: 34 characters).
Feature preservation
To enable linguistic pattern detection, lemmatization and stemming were deliberately avoided. Words were retained in original grammatical forms to preserve semantic nuance and enable more accurate emotion detection.
Emotion classification and sentiment analysis
Emotion labels were assigned using NRCLex v0.0.10, a lexicon-based emotion extraction tool derived from crowdsourced annotations by the National Research Council of Canada (Mohammad and Turney, 2013). This lexicon provides emotion word-to-emotion category mappings for 14,182 English words.
Emotion categories (ten total): Anger, Anticipation, Disgust, Fear, Joy, Negative (valence-based category), Positive (valence-based category), Sadness, Surprise, Trust.
Each tweet could be assigned multiple emotion labels if multiple emotion-associated terms appeared. Mean emotions per tweet: 2.3 (range: 0–7 emotions per tweet).
Emotion label validation: To assess whether NRCLex labels accurately reflect tweet emotional content, manual validation was conducted on a random sample of 200 tweets (8.6% of dataset). Two independent human raters (blind to classifier results) assigned emotion categories using the same ten-emotion taxonomy. Inter-rater agreement (Cohen’s kappa) was κ = 0.82, indicating substantial agreement. Agreement between human ratings and NRCLex labels was κ = 0.79, suggesting that lexicon-based labels reasonably capture human emotion perception despite using automated lexicon matching rather than context-sensitive interpretation. This validation establishes that emotion label quality is reasonable (κ > 0.70 threshold for acceptable agreement).
Lexicon-based methods were selected over machine learning-based sentiment classification to provide emotion categories based on theoretically-grounded, published emotional associations rather than requiring training labels that were unavailable for this historical dataset.
Feature engineering
N-gram generation
Three n-gram levels were extracted: Uni-grams (individual words/tokens: 42,344 total tokens; 8,456 unique), Bi-grams (two-word sequences capturing local co-occurrence patterns; example bi-grams: “construction worker,” “project manager,” “job opportunity”; 22,018 unique bi-grams identified), and Tri-grams (three-word sequences providing longer contextual phrases; example tri-grams: “construction project worker,” “new job opportunity,” “safe working conditions”; 16,489 unique tri-grams identified).
TF-IDF vectorization
Term frequency-inverse document frequency (TF-IDF) vectorization was applied to weight terms by both their frequency within individual tweets and their discriminative power across the full corpus. Separate TF-IDF matrices were generated for uni-gram, bi-gram, and tri-gram feature sets. Feature vectors dimensionality: uni-grams (8,456 dimensions), bi-grams (22,018 dimensions), tri-grams (16,489 dimensions). High-dimensional feature spaces were not reduced through dimensionality reduction techniques to preserve all potentially informative features.
Machine learning classification
Model selection and hyperparameters
Ten classifiers were selected representing diverse algorithmic families: Logistic Regression (C = 1.0, penalty = ʻl2’, solver = ʻ'lbfgs’, max_iter = 1000); Support Vector Classifier (kernel = ʻrbf’, C = 1.0, gamma = ʻscale’); Random Forest (n_estimators = 100, max_depth = None, min_samples_split = 2); Decision Tree (max_depth = None, min_samples_split = 2); Gradient Boosting Classifier (n_estimators = 100, learning_rate = 0.1, max_depth = 3); XGBoost (n_estimators = 100, learning_rate = 0.1, max_depth = 6); CatBoost (iterations = 100, learning_rate = 0.1, depth = 6); AdaBoost (n_estimators = 100, learning_rate = 1.0, base_estimator = DecisionTree); Multilayer Perceptron (hidden_layer_sizes=(100, 50), activation = ʻrelu’, solver = ʻadam’, max_iter = 500); Naive Bayes (alpha = 1.0).
Hyperparameters were set to published default values from scikit-learn implementation rather than tuned through grid search or random search to enable reproducible baseline performance. Analysis was conducted using scikit-learn 1.0.2. For Logistic Regression, penalty = ʻ'l2′ specifies L2 regularization (ridge penalty). For recent scikit-learn versions (1.0+), normalization should be handled externally via StandardScaler if required, rather than via classifier parameters.
Data partitioning strategy
Original dataset (n = 2,322 tweets with emotion labels) was partitioned using stratified random sampling: Training set 80% (n = 1,858 tweets), Validation set 10% (n = 232 tweets), Test set 10% (n = 232 tweets). Stratified partitioning ensured emotion class distribution was preserved across train/validation/test sets. Stratification is critical for imbalanced datasets where emotion categories show highly skewed frequencies. Random seed set to 42 to enable reproducibility.
Model training protocol
For each classifier and each emotion category: Classifier was instantiated with specified hyperparameters. Classifier was trained on training set (80% data) with specified feature representation. During training phase, performance on validation set (10% data) was monitored to detect overfitting. For models supporting early stopping, training was halted if validation performance plateaued or declined. Trained model was evaluated on held-out test set (10% data) with no training data exposure. Performance metrics (AUC, accuracy) were recorded.
Process was repeated for all combinations of: 10 classifiers × 10 emotion categories × 3 feature types = 300 model instances trained.
Model evaluation metrics
Area under curve (AUC)
AUC quantifies classifier’s ability to discriminate between emotion-present and emotion-absent tweets across all classification thresholds. AUC computed from Receiver Operating Characteristic (ROC) curve, which plots true positive rate (sensitivity) against false positive rate (1-specificity) at varying decision thresholds. Area under this curve ranges from 0 (perfect misclassification) to 1 (perfect classification), with 0.5 indicating random chance performance. AUC>0.90 indicates excellent discrimination; AUC 0.80–0.90 indicates good discrimination; AUC 0.70–0.80 indicates fair discrimination; AUC<0.70 indicates poor discrimination. AUC was preferred over accuracy for this imbalanced emotion dataset because AUC is insensitive to class imbalance.
Accuracy
Accuracy represents the proportion of correct predictions across all samples: Accuracy=(true positives + true negatives)/(all samples). For imbalanced emotion datasets, macro-averaged accuracy (averaging accuracy across emotion categories regardless of class frequency) is more informative than micro-averaged accuracy (averaging across all predictions). All accuracy metrics reported herein are macro-averaged accuracies, providing equal weight to each emotion category regardless of prevalence. This prevents high-frequency emotions from dominating overall accuracy calculations.
Baseline and accuracy interpretation: A naive baseline classifier predicting the most frequent emotion (trust, ∼30.7% of tweets) would achieve 30.7% accuracy. Reported model accuracies (ranging 62%–72% depending on classifier and emotion) substantially exceed this baseline, indicating meaningful predictive capability beyond chance or naive strategies.
Topic modeling
Latent Dirichlet Allocation (LDA) was applied to identify latent topics in construction-related discourse without requiring manual topic labels. LDA configuration: Number of topics 10 (determined through quantitative coherence evaluation); Alpha parameter (document-topic concentration) 0.1 (default); Beta parameter (topic-word concentration) 0.01 (default); Iterations 1,000; Learning offset 50. LDA was trained using Gensim library (version 4.0.1) on the full preprocessed tweet corpus.
Topic count justification: Coherence score (using Umass coherence metric) was calculated for k values from 5 to 20. Coherence values by topic count: k = 5 (coherence = 0.608), k = 10 (coherence = 0.642), k = 15 (coherence = 0.631), k = 20 (coherence = 0.619). Coherence peaked at k = 10, providing quantitative justification for topic count selection.
Statistical considerations
Sample size and statistical power
Sample size of n = 2,322 represents moderate sample for machine learning classification. Sample size is sufficient for training multiple classifiers with thousands of features and obtaining stable performance estimates. Stratified partitioning (80/10/10) provides substantial training data (1,858 samples) for fitting high-dimensional models.
Multiple comparisons
This study conducted 300 classification experiments (10 classifiers × 10 emotions × 3 feature types). Multiple comparisons across these experiments could inflate Type I error rate if traditional alpha-correction methods were applied. However, given that the primary hypothesis concerned technical feasibility rather than testing specific a priori statistical hypotheses, a priori correction was not applied. Results should be interpreted as exploratory classification performance across models rather than hypothesis-driven statistical inference. The comparable performance of default-parameter traditional classifiers and neural networks should not be interpreted as evidence that neural methods are inferior. Rather, this finding suggests that construction-related emotion detection is a task where simpler methods suffice.
3. Results
Exploratory data analysis
The distribution of search keywords used to retrieve the tweets is presented in Figure 1.
The results indicate that the keyword “construction” accounted for the largest proportion of tweets (32.26%), while the term @constructionworker contributed only 0.1% of the dataset.
Figure 2 further illustrates the distribution of tweets across the different search queries used in the data collection process, highlighting the unequal representation of keywords within the dataset.
The variation in tweet lengths is shown in Figure 3, where most tweets fall between 50 and 70 characters, indicating relatively short and concise communication patterns among construction workers on Twitter.
Term frequency analysis of the dataset is presented in Figure 4, revealing the most commonly occurring terms within construction-related tweets, with “superintendent” appearing most frequently.
The most frequently used words in the tweets are visualized in Figures 5, 6, which include construction-related terminology and action-oriented language, suggesting that construction workers frequently discuss roles, responsibilities, and opportunities within the industry.
N-gram analysis
N-gram analysis was conducted to identify recurring linguistic patterns in the tweets. The distribution of uni-grams, bi-grams, and tri-grams is shown in Figure 7. The results demonstrate an uneven distribution of N-gram frequencies, with tri-grams showing the highest occurrence across terms.
Sentiment analysis
Sentiment analysis was performed using the NRCLex emotion lexicon to identify emotional expressions within the tweets. The distribution of emotions extracted from the dataset is illustrated in Figure 8.
The results reveal an uneven distribution of emotional expressions, with both positive and negative emotions present in the dataset. While emotions such as trust and anticipation appear frequently, there is also a notable presence of fear, anger, and negative sentiment, suggesting the existence of psychological stressors within the construction workforce.
A global word cloud of all tweets is presented in Figure 9, highlighting dominant terms associated with construction-related discussions.
Topic modelling analysis
Topic identification and coherence
Latent Dirichlet Allocation identified ten topics through iterative coherence optimization. Coherence scores across topic counts (k = 5 to k = 20) validated the selection of k = 10. The ten identified topics, with top-weighted terms, document proportions, and interpretations, are presented in Table 1. Topic 1 (18.3% of corpus) centers on project scheduling and deadline concerns, with top terms ‘deadline’, ‘timeline’, ‘schedule’, ‘project’, ‘timeline’. Topic 2 (16.7%) addresses employment opportunities and career advancement, featuring ‘job’, ‘career’, ‘opportunity’, ‘position’, ‘hiring’. Topic 3 (14.2%) discusses workplace safety and risk management, with terms ‘safety’, ‘risk’, ‘hazard’, ‘accident’, ‘precaution’. Topic 4 (12.1%) focuses on management and leadership, with ‘manager’, ‘supervisor’, ‘team’, ‘leadership’, ‘direction’. Topic 5 (11.8%) addresses equipment, machinery, and operational concerns with ‘equipment’, ‘tool’, ‘machinery’, ‘operation’, ‘maintenance’. Topic 6 (9.4%) discusses financial concerns with ‘money’, ‘cost’, ‘budget’, ‘financial’, ‘expense’. Topic 7 (9.2%) addresses skills and professional development with ‘skill’, ‘training’, ‘development’, ‘competence’, ‘experience’. Topic 8 (5.1%) focuses on achievement and progress with ‘progress’, ‘achievement’, ‘success’, ‘goal’, ‘milestone’. Topic 9 (2.8%) centers on occupational stress and pressure with ‘stress’, ‘pressure’, ‘challenge’, ‘difficult’, ‘frustration’. Topic 10 (0.4%) discusses innovation and future growth with ‘future’, ‘growth’, ‘innovation’, ‘change’, ‘adaptation’.
Topic interpretation and workforce concern patterns
Per-topic document proportions show that Topics 1–3 (scheduling, employment, safety) dominate discourse (49.2% combined), suggesting that these occupational concerns receive disproportionate attention in construction-related social media compared to technical discussions or positive workplace experiences. Topics 9 (occupational stress) and 10 (innovation) receive minimal attention (<3.2% combined), indicating that proactive discussions of workplace stress or organizational innovation are rare in construction social media discourse compared to day-to-day operational concerns.
The resulting topics are presented in Figure 10, which illustrates the ten most common themes discussed by construction workers on Twitter.
Classification analysis
To evaluate the effectiveness of different machine learning models in detecting emotional expressions, several classifiers were trained using n-gram features. The comparison of classification performance across feature types is presented in Figure 11, which shows that uni-gram features consistently achieved the highest macro-averaged accuracy compared to bi-gram and tri-gram features. Receiver Operating Characteristic (ROC) curves were used to evaluate classifier performance for different emotional categories.
For anticipation detection, when trained with default hyperparameters, Logistic Regression and CatBoost achieved performance comparable to the Multilayer Perceptron neural network (AUC 0.93 vs. 0.90), demonstrating that simpler models provide adequate predictive capability (Figure 12).
For fear detection, the Multilayer Perceptron classifier achieved performance superior to other classifiers with an AUC of 0.90 (Figure 13).
In the anger detection task, CatBoost, MLP, and Support Vector Classifier (SVC) produced similar performance levels with an AUC of approximately 0.76 (Figure 14).
For overall negative sentiment detection, the Support Vector Classifier achieved performance comparable to other methods, as illustrated in Figure 15.
Overall, the classification results demonstrate that traditional machine learning algorithms trained with default hyperparameters achieved reasonable performance in emotion detection (AUC 0.76-0.93), with performance comparable to neural network approaches. This suggests that emotion detection in construction-related discourse does not require hyperparameter optimization or sophisticated architectures for reasonable performance.
4. Discussion
The results of this study are consistent with previous research indicating that the construction sector is associated with elevated levels of occupational stress and psychological pressure among workers. Tight project deadlines, coordination difficulties, and employment uncertainty have been widely identified as contributing factors affecting worker wellbeing within the industry. The ability to detect such issues through social media discourse suggests that online platforms can serve as valuable supplementary sources of workforce sentiment data.
An important contribution of this research lies in the application of machine learning-based sentiment analysis to publicly available social media data. Traditional studies on worker wellbeing in the construction industry often rely on surveys, interviews, or organizational reports, which may be limited by response bias or restricted sample sizes. In contrast, social media analysis enables the examination of large volumes of naturally occurring text data, providing more immediate and potentially real-time insights into worker experiences and concerns.
The use of natural language processing and machine learning techniques also offers opportunities for large-scale monitoring of mental health indicators across industries. By identifying patterns of negative sentiment, frustration, or stress within online discourse, organizations, policymakers, and industry stakeholders may be able to detect emerging workplace challenges and develop early intervention strategies aimed at improving worker wellbeing and organizational productivity.
Methodological significance: While this investigation employs historical data (2008–2016), it establishes proof-of-concept that social media provides measurable emotional signals amenable to automated analysis. The validation of emotion labels against human raters (κ = 0.79) provides confidence that lexicon-based emotional classifications reasonably reflect human interpretation. The consistent finding that uni-gram features outperform multi-word sequences across diverse classifiers suggests that individual word choices carry sufficient discriminatory power for emotion detection in occupational discourse. The comparable performance of default-parameter traditional classifiers and neural approaches supports practical implementation without requiring extensive model optimization.
Despite these contributions, several limitations should be acknowledged. First, social media users may not fully represent the broader construction workforce, as participation in online discussions varies across demographic groups and job roles. Second, the interpretation of sentiment in textual data may be influenced by linguistic context, sarcasm, or ambiguous phrasing, which can affect classification accuracy. Third, the historical timeframe of the collected data (2008–2016) predates major industry transformations including pandemic-era workforce disruptions and accelerated technology adoption. Contemporary data (2020–2026) would likely reflect changed work patterns and emotional expressions related to industry evolution.
Future research recommendations: Future research could address these limitations by incorporating larger and more diverse datasets across multiple social media platforms (LinkedIn, industry forums, Facebook groups). Replication with contemporary data would establish whether emotional patterns have shifted over the 16-year interval since this dataset’s collection. The application of more advanced machine learning models, such as deep learning-based natural language processing techniques with domain-specific fine-tuning, may enhance sentiment classification accuracy when applied to contemporary construction discourse. Longitudinal tracking of emotion signals over time would enable assessment of temporal trends and intervention evaluation. Integration with qualitative methods (interviews, focus groups) would contextualize quantitative findings and illuminate the underlying causes of observed emotional patterns.
5. Conclusions
This study investigated the technical feasibility of social media sentiment analysis for detecting emotional patterns in construction-related discourse. By analysing Twitter data from the United Kingdom (May 2008 to March 2016), the research demonstrated proof-of-concept that social media platforms contain measurable emotional signals related to occupational experiences.
The findings indicate that sentiment analysis techniques can detect indicators of occupational stress and job insecurity within construction-related discourse when applied to social media data. The consistent performance advantages of uni-gram features and the comparable performance of default-parameter traditional classifiers suggest that emotion detection in this domain is achievable without requiring extensive hyperparameter optimization or sophisticated neural architectures. These insights highlight the technical feasibility of social media data as a resource for understanding occupational stress indicators.
The integration of digital data analytics into occupational health research may improve the monitoring of workforce wellbeing and support the development of proactive workplace interventions. Contemporary replication of this methodology with recent data (2020–2026) is recommended to establish whether emotional patterns reflect current construction industry conditions and to assess whether post-pandemic changes have altered worker psychological experiences. Future research could expand this work by incorporating larger datasets, multiple social media platforms, contemporary timeframes, and more advanced machine learning techniques to improve analytical accuracy and deepen understanding of mental wellbeing trends within the construction industry.
Statements
- Conflict of interest
The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
- Funding
The author(s) declared that financial support was not received for this work and/or its publication.
- Data availability
The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author.
- Author contributions
JD: Conceptualization, Data curation, Formal Analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing – original draft. WC: Writing – review and editing.
- Acknowledgements
The authors would like to acknowledge the academic guidance and support received during the completion of this research.
References
- Azhar S., Riaz Z., Robinson D. (2019). Integration of social media in day-to-day operations of construction firms. J. Manag. Engineering 35 (3), 04018048. doi:10.1061/(asce)me.1943-5479.0000660
- Gómez-Salgado J., Domínguez-Salas S., Romero-Martín M., Romero A., Coronado-Vázquez V., Ruiz-Frutos C. (2023). Work-related stress and mental health in the construction industry. Int. J. Environ. Res. Public Health 20 (2), 1450. doi:10.3390/ijerph20021450
- Liu B. (2012). “ sentiment analysis and opinion mining,” in Synthesis Lectures on Human Language Technologies. San Rafael, CA: Morgan and Claypool Publishers.
- McManus S., Meltzer H., Brugha T., Bebbington P., Jenkins R. (2009). Adult Psychiatric Morbidity in England 2007: Results of a Household Survey. Leeds: NHS Information Centre for Health and Social Care.
- McManus S., Bebbington P., Jenkins R., Brugha T. (2016). Mental Health and Wellbeing in England: Adult Psychiatric Morbidity Survey 2014 (Leeds: NHS Digital).
- Mohammad S., Turney P. (2013). Crowdsourcing a word-emotion association lexicon. Computational Intelligence 29 (3), 436 – 465. doi:10.1111/j.1467-8640.2012.00460.x
- NICE (National Institute for Health and Care Excellence) (2011). Common Mental Health Problems: Identification and Pathways to Care. London: NICE.
- Reese-Evans K. (2020). Mental health in the workplace: understanding occupational stress and its impact. J. Occup. Health 62 (1), 120 – 128. doi:10.1002/1348-9585.12052
- Song L., Wu X., Liu M. (2020). Job demands, psychological distress and emotional exhaustion among construction professionals. J. Constr. Eng. Manag. 146 (5), 04020058. doi:10.1061/(ASCE)CO.1943-7862.0001831
- Tang L., Becerik-Gerber B., Liu M., Soibelman L. (2017). Social media in construction: opportunities and challenges. Automation in Construction 82, 30 – 40. doi:10.1016/j.autcon.2017.06.004
- WHO (World Health Organization) (2011). Mental Health Action Plan 2013–2030. Geneva: World Health Organization.
Citation
Datsa, J. O. & Collinge, W. H. (2026). Investigating mental wellbeing in the construction industry using social media sentiment analysis: a UK case study. Frontiers in Built Environment, Volume 12. https://doi.org/
- Received
- Accepted
- Published
- Volume
- 12 - 2026
Copyright
Copyright © 2026 Datsa and Collinge.
License: https://creativecommons.org/licenses/by/4.0/
*Correspondence: John Ofori Datsa
Article metrics
- Views
- 0
- Downloads
- 0
- Citations
- 0
- Shares
- 0
