2025-11-24T02:19:18.891948

Leveraging Twitter Data for Sentiment Analysis of Transit User Feedback: An NLP Framework

Das, Prajapati, Zhang et al.
Traditional methods of collecting user feedback through transit surveys are often time-consuming, resource intensive, and costly. In this paper, we propose a novel NLP-based framework that harnesses the vast, abundant, and inexpensive data available on social media platforms like Twitter to understand users' perceptions of various service issues. Twitter, being a microblogging platform, hosts a wealth of real-time user-generated content that often includes valuable feedback and opinions on various products, services, and experiences. The proposed framework streamlines the process of gathering and analyzing user feedback without the need for costly and time-consuming user feedback surveys using two techniques. First, it utilizes few-shot learning for tweet classification within predefined categories, allowing effective identification of the issues described in tweets. It then employs a lexicon-based sentiment analysis model to assess the intensity and polarity of the tweet sentiments, distinguishing between positive, negative, and neutral tweets. The effectiveness of the framework was validated on a subset of manually labeled Twitter data and was applied to the NYC subway system as a case study. The framework accurately classifies tweets into predefined categories related to safety, reliability, and maintenance of the subway system and effectively measured sentiment intensities within each category. The general findings were corroborated through a comparison with an agency-run customer survey conducted in the same year. The findings highlight the effectiveness of the proposed framework in gauging user feedback through inexpensive social media data to understand the pain points of the transit system and plan for targeted improvements.
academic

Leveraging Twitter Data for Sentiment Analysis of Transit User Feedback: An NLP Framework

Basic Information

  • Paper ID: 2310.07086
  • Title: Urban Echoes: Decoding Transit Riders' Sentiments on Social Media for Smarter Mobility
  • Authors: Adway Das, Abhishek Kumar Prajapati, Pengxiang Zhang, Mukund Srinath, Andisheh Ranjbari
  • Affiliated Institutions: The Pennsylvania State University, Optym Inc.
  • Classification: cs.AI cs.SI
  • Publication Date: October 2023 (arXiv v2: October 2025)
  • Paper Link: https://arxiv.org/abs/2310.07086v2

Abstract

Traditional transit surveys consume substantial resources and time, limiting their effectiveness in addressing location-specific issues. This research proposes an NLP-based framework that leverages real-time Twitter (now X) data as a pre-screening tool to optimize and direct transit agency surveys. The framework employs a two-step approach: Few-Shot learning classifies tweets into categories such as safety, reliability, and maintenance, while a lexicon-based sentiment analysis model assesses sentiment polarity (positive, negative, neutral) and intensity. Additionally, spatial analysis maps sentiment trends to specific geographic regions, enabling transit agencies to precisely identify and prioritize problem areas.

Research Background and Motivation

Core Issues

  1. Limitations of Traditional Surveys: Transit user feedback surveys are costly, time-consuming, and geographically limited. Research indicates that the per-capita cost of transit agency surveys is approximately 36,withaveragetotalcostsformediumscalesurveysreachingapproximately36, with average total costs for medium-scale surveys reaching approximately 350,000.
  2. Potential of Social Media Data: Twitter has over 3.3 billion active users generating approximately 500 million tweets daily, providing a unique opportunity for large-scale, real-time insights into user sentiment and experience.
  3. Geographic Precision Requirements: Social media data can reveal location-specific issues and sentiments, enabling transit agencies to identify unique needs and challenges across different communities.

Research Significance

  • Resource Optimization: Pre-screening through social media data can significantly reduce survey costs and improve efficiency
  • Real-time Monitoring: Enables continuous monitoring of public opinion for decision-making
  • Spatial Precision: Identifies high-concern areas for targeted interventions
  • Transit Equity: Ensures all communities have access to safe and reliable transportation options

Core Contributions

  1. Proposed an Innovative NLP Framework: A multifaceted approach combining Few-Shot learning and VADER sentiment analysis
  2. Achieved Precise Tweet Classification: Classified tweets into service-related categories including maintenance, safety, and scheduling
  3. Provided Spatial-Temporal Analysis: Identified recurring complaints and concerns in specific geographic locations
  4. Validated Framework Effectiveness: Through case study of NYC subway system and comparison with MTA official surveys
  5. Constructed a Scalable Solution: Applicable across different regions, time periods, and multiple service providers

Methodology Details

Task Definition

Input: Twitter tweet text, timestamps, geographic tags Output: Tweet category classification, sentiment polarity and intensity scores, spatial distribution analysis Constraints: Tweets must be transit system-related, requiring handling of informal language and social media-specific expressions

Model Architecture

1. Data Collection and Preprocessing

  • Data Source: Collected via Twitter API and snscrape tools
  • Search Strategy: Utilized 10 unique search terms ("MTA", "NYC SUBWAY", etc.) and 12 relevant locations
  • Filtering: Removed duplicate tweets and embedded links
  • Data Scale: Random sampling of 36,000 tweets from 102,530 total tweets for analysis

2. Few-Shot Learning Classification Module

Model Selection: OpenAI GPT-3.5 Turbo Classification Categories:

  • Cleanliness and Maintenance: Discusses subway system cleanliness and maintenance issues
  • Scheduling and Operations: Involves subway schedules, delays, punctuality, etc.
  • Safety and Security: Highlights user safety and security-related concerns
  • Other: Tweets unrelated to transit user experience

Few-Shot Configuration: Five samples per category for training, balancing performance and resource efficiency

3. VADER Sentiment Analysis Module

Core Principle: Maps lexical features to sentiment intensity scores based on pre-constructed sentiment lexicon Score Range: Word-level scores from -4 to 4, sentence-level compound scores from -1 to +1 Normalization Formula: CSCi=xixi2+αCSC_i = \frac{x_i}{\sqrt{x_i^2 + \alpha}} where xix_i is the sum of sentiment scores of constituent words in tweet i, and α=15\alpha=15 is the normalization parameter

Sentiment Classification Thresholds:

  • Positive sentiment: compound score > 0.1
  • Negative sentiment: compound score < -0.1
  • Neutral sentiment: -0.1 ≤ compound score ≤ 0.1

Technical Innovations

  1. Few-Shot Learning Application: Addresses the difficulty of large-scale tweet annotation, achieving high-precision classification with minimal labeled samples
  2. Multimodal Analysis Framework: Comprehensive analysis considering classification, sentiment, and spatial dimensions simultaneously
  3. Spatial Mapping Strategy: Maps geographically tagged tweets to subway stations within a 1-mile radius, enabling precise spatial analysis
  4. Real-time Processing Capability: Framework design supports real-time processing and analysis of large-scale social media data

Experimental Setup

Dataset

  • Dataset Name: NYC Subway System-related Twitter Data
  • Data Scale: 36,000 tweets (sampled from 102,530)
  • Time Range: Full year 2022
  • Geographic Range: NYC subway service area and extended regions
  • Validation Set: 500 manually annotated tweets for model validation

Evaluation Metrics

  • Classification Performance: Precision, Recall, F1-Score
  • Sentiment Analysis: Compound sentiment scores, sentiment polarity distribution
  • Spatial Analysis: Geographic distribution heatmaps, regional sentiment aggregation

Comparison Methods

  • Baseline Comparison: MTA Fall 2022 Customer Survey results
  • Temporal Comparison: MTA Spring and Fall survey result trends

Implementation Details

  • Classification Model: GPT-3.5 Turbo with Few-Shot configuration of 5 samples per category
  • Sentiment Analysis: VADER model without preprocessing steps
  • Spatial Analysis: 1-mile radius subway station mapping strategy

Experimental Results

Main Results

Classification Performance

MetricValue
Precision0.9456
Recall0.9420
F1-Score0.9425

Tweet Classification Distribution

CategoryTweet CountPercentage
Cleanliness/Maintenance1,6674.6%
Scheduling/Operations6,05016.8%
Safety/Security7,70821.5%
Other20,57557.1%

Key Finding: Safety and security represent the highest concern (21.5%), followed by scheduling-related issues (16.8%)

Temporal Trend Analysis

  • Peak Satisfaction Period: March and summer months (June-September)
  • Negative Tweet Proportion Change: Decreased from 33% in April-May to 28% in June-August
  • Consistency with MTA Survey: Fall 2022 survey showed 54% subway customer satisfaction, a 6 percentage point increase from spring survey

Spatial Analysis Results

  • Safety Concern Concentration Areas: Midtown and Financial District
  • Scheduling Problem Hotspots: Upper Manhattan and Queens
  • Persistent Negative Feedback Areas: Times Square, Central Park and other high-traffic tourist areas
  • Specific Safety Problem Areas: Upper East Side and East Harlem

Case Analysis

The paper provides eight specific tweet examples demonstrating the framework's capability in handling complex sentiments (such as irony) and accurate classification. For example:

  • Negative maintenance tweet: "Why would you WANT to ride the subway without a mask? It is so stinky" (score: -0.6651)
  • Positive scheduling tweet: Thank you tweet for train conductor keeping doors open (score: 0.7701)

Sentiment Analysis Applications in Public Transportation

  • Machine Learning Methods: SVM, Naive Bayes, Decision Trees, BERT, etc.
  • Lexicon Methods: SentiWordNet, VADER, TextBlob, Afinn, LIWC, etc.
  • Application Cases: Chicago Transit Authority, London Underground system sentiment analysis research

Social Media Data Applications in Transportation Research

  • T-MAPS Model: Spatiotemporal model for NYC transportation insights
  • Singapore Transit System: Real-time public opinion tracking during peak hours
  • Toronto Transit System: Topic classification of social media posts

Topic Classification and Big Data Annotation Challenges

  • Traditional Method Limitations: Require large annotated datasets with limited generalization capability
  • Pre-trained Model Advantages: Few-Shot learning capabilities of large language models like GPT and LLaMA
  • Few-Shot Learning Applications: Movie reviews, product feedback, dialogue system intent classification and other domains

Conclusions and Discussion

Main Conclusions

  1. Framework Effectiveness: The proposed NLP framework accurately classifies tweets and measures sentiment intensity, showing high consistency with official survey results
  2. Cost-Benefit: Social media data analysis can serve as a viable alternative or supplement to expensive user surveys
  3. Spatial Precision: Capable of identifying problem concentration points in specific geographic regions, supporting precise resource allocation
  4. Real-time Monitoring Capability: Provides continuous public opinion monitoring and data-driven decision support

Limitations

  1. Data Bias: Social media user demographics skew toward younger users, potentially not fully representing all passenger groups
  2. Geographic Precision: Tweet geographic tags may be inaccurate, with inherent errors in the 1-mile mapping strategy
  3. Language Complexity: Complex linguistic expressions such as irony and slang remain challenging
  4. Privacy Ethics: Using public social media data requires careful handling of privacy and ethical concerns

Future Directions

  1. Multilingual Support: Extend framework to handle multilingual tweet data
  2. Real-time Processing Optimization: Improve real-time processing capabilities for large-scale data
  3. Cross-domain Applications: Apply framework to airports, transit systems, parking facilities, shared mobility services, and other transportation services
  4. Fare Policy Analysis: Evaluate impact of fare changes on user satisfaction

In-Depth Evaluation

Strengths

  1. Strong Methodological Innovation: The combination of Few-Shot learning and VADER sentiment analysis is innovative, effectively addressing large-scale annotation challenges
  2. Comprehensive Experimental Design: Large-scale analysis of 36,000 tweets, validation with 500 manually annotated tweets, and comparison with official surveys
  3. High Practical Value: Provides transit agencies with a cost-effective alternative for user feedback collection
  4. In-depth Spatial Analysis: Geographic dimension sentiment analysis provides strong support for targeted interventions
  5. High Result Credibility: Consistency with MTA official survey results enhances framework credibility

Limitations

  1. Limited Generalization Capability: Validated only on NYC subway system; applicability to other cities and transit systems requires further verification
  2. Temporal Scope Limitation: Analysis limited to 2022 data; long-term trend analysis is insufficient
  3. Technology Dependency: Relies on commercial API (GPT-3.5), potentially facing cost and availability issues
  4. Single Evaluation Metric: Primarily relies on comparison with official surveys, lacking validation from multiple dimensions

Impact

  1. Academic Contribution: Provides new methodological framework for social media data analysis in transportation domain
  2. Practical Value: Offers actionable technical solutions for transit agencies worldwide
  3. Policy Implications: Supports data-driven transportation policy formulation and resource allocation optimization
  4. Cross-domain Inspiration: Methods extensible to user feedback analysis in other public service sectors

Applicable Scenarios

  1. Transit System Optimization: Service improvement for subways, buses, light rail, and other public transportation systems
  2. Urban Planning: Traffic infrastructure planning based on user feedback
  3. Emergency Response: Public sentiment monitoring during traffic accidents or service disruptions
  4. Policy Evaluation: Real-time assessment of transportation policy implementation effectiveness
  5. Commercial Applications: User experience analysis for shared mobility, taxi services, and other commercial transportation services

References

The paper cites 64 relevant references spanning sentiment analysis, natural language processing, transportation research, social media analysis, and other domains, providing solid theoretical foundation and methodological support for this research.


Overall Assessment: This is a high-quality applied research paper that successfully applies advanced NLP techniques to practical urban transportation challenges. The paper demonstrates methodological innovation, comprehensive experimentation, and credible results, with significant academic and practical value. While certain limitations exist, it provides valuable technical pathways and practical experience for digital transformation in the transportation sector.