Skip to content

AbdulRehman393/streamlit-airline-sentiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›« Airline Sentiment Dashboard

Interactive Data Visualization & Sentiment Analysis Platform for US Airlines Twitter Data

Python 3.8+ Streamlit License: MIT GitHub Stars


πŸŽ‰ Live Demo

πŸš€ Try the Live Application Here!

The application is now deployed and live. Click the link above to explore the interactive dashboard!


πŸ“‹ About

This is a modern, interactive web application built with Streamlit and Python that provides deep insights into customer sentiment across major US airlines through Twitter data analysis. The dashboard offers real-time sentiment visualization, geographic tweet distribution, airline comparison analytics, and word cloud generationβ€”all in an intuitive, user-friendly interface.

Perfect for data analysts, business intelligence professionals, and anyone interested in social media sentiment analysis, this tool transforms raw tweet data into actionable business intelligence about customer satisfaction and airline performance.


✨ Key Features

🎯 Core Capabilities

  • πŸ“Š Sentiment Distribution Analysis

    • Visualize tweet counts across positive, neutral, and negative sentiments
    • Toggle between histogram and pie chart visualizations
    • Real-time sentiment metrics and statistics
  • πŸ—ΊοΈ Geographic & Temporal Analysis

    • Interactive map showing tweet locations by time of day
    • Hour-based filtering (0-23 hours)
    • Identify peak tweeting patterns and geographic hotspots
  • ✈️ Airline Breakdown Analytics

    • Compare sentiment across 6 major US airlines (US Airways, United, American, Southwest, Delta, Virgin America)
    • Multi-select airline comparison
    • Faceted visualization by sentiment type
  • ☁️ Word Cloud Generation

    • Generate dynamic word clouds for each sentiment category
    • Automatic filtering of URLs, usernames, and retweets
    • Stop word removal for meaningful insights
  • πŸ“± Random Tweet Display

    • Explore individual tweets by sentiment category
    • Understand real customer feedback and experiences

πŸ–ΌοΈ Project Demo

Sentiment Distribution Visualization

Tweets by Sentiment Overview of tweet distribution across positive, neutral, and negative sentiments with interactive histogram and pie chart options

Geographic & Temporal Analysis

Location and Hour Analysis Interactive map showing tweet locations filtered by time of day for pattern identification

Airline Breakdown Comparison

Airline Sentiment Breakdown Detailed comparison of sentiment distribution across different airlines with faceted visualizations

Word Cloud Analysis

Word Cloud Dynamic word cloud visualization highlighting the most frequent terms in each sentiment category


πŸš€ Getting Started

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Installation & Local Setup

  1. Clone the repository

    git clone https://github.com/AbdulRehman393/streamlit-airline-sentiment.git
    cd streamlit-airline-sentiment
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the application locally

    streamlit run app.py
  4. View in browser

    • Streamlit will automatically open your browser to http://localhost:8501
    • If not, manually navigate to that URL

πŸ“¦ Project Structure

streamlit-airline-sentiment/
β”œβ”€β”€ app.py                    # Main Streamlit application
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ data/
β”‚   └── Tweets.csv           # US Airlines Twitter sentiment dataset
β”œβ”€β”€ images/                  # Project demo screenshots
β”‚   β”œβ”€β”€ tweets_by_sentiments.png
β”‚   β”œβ”€β”€ location_and_hour.png
β”‚   β”œβ”€β”€ breakdown_airline_tweets.png
β”‚   └── word_cloud.png
└── README.md               # Documentation

πŸ“Š Technologies & Libraries

Technology Purpose
Streamlit Web app framework for rapid UI development
Pandas Data manipulation and analysis
NumPy Numerical computing
Plotly Interactive data visualizations
Matplotlib Static plotting and figure creation
WordCloud Text visualization and word frequency analysis

πŸ’‘ How It Works

Data Processing Pipeline

  1. Data Loading: CSV file is loaded from GitHub and cached using Streamlit's @st.cache_data decorator
  2. Timestamp Parsing: Tweet creation times are converted to datetime format
  3. Sentiment Analysis: Data is pre-classified as positive, neutral, or negative
  4. Visualization: Multiple visualization types transform data into actionable insights

Interactive Dashboard Features

  • Sidebar Controls: Intuitive controls for filtering and toggling visualizations
  • Dynamic Filtering: Real-time data updates based on user selections
  • Responsive Layout: Automatically adapts to different screen sizes
  • Performance Optimization: Caching prevents redundant data processing

πŸ“ˆ Use Cases

  • Customer Experience Monitoring: Track airline customer satisfaction trends
  • Competitive Analysis: Compare sentiment across competing airlines
  • Crisis Detection: Identify sudden spikes in negative sentiment
  • Marketing Insights: Understand what customers are talking about on social media
  • Business Intelligence: Data-driven decision making for airline management

🌐 Deployment

Streamlit Cloud (Current Deployment)

This project is deployed on Streamlit Cloud and is live at:

https://app-airline-sentiment-8mwwconsnxvhqrfy6yhicz.streamlit.app/

To deploy your own version:

  1. Push your code to GitHub
  2. Visit Streamlit Cloud
  3. Sign up with your GitHub account
  4. Click "New app"
  5. Select your repository: AbdulRehman393/streamlit-airline-sentiment
  6. Set main file to app.py
  7. Click "Deploy"

πŸ”§ Customization

Modify Data Source

Update the DATA_URL variable in app.py:

DATA_URL = "https://raw.githubusercontent.com/your-username/your-repo/main/data/Tweets.csv"

Add More Airlines

Edit the airline selection in the sidebar:

choice = st.sidebar.multiselect('Pick Airlines', 
    ('Your Airlines Here'), key = 'airline_selection')

Adjust Visualizations

Customize Plotly and Matplotlib settings for different color schemes, sizes, and styles.


πŸ“ Dataset Information

The application uses Twitter data about US Airlines including:

  • Airlines: US Airways, United, American, Southwest, Delta, Virgin America
  • Sentiment Labels: Positive, Neutral, Negative
  • Tweet Information: Text content, creation timestamp, airline reference, geographic location
  • Scale: Comprehensive dataset with thousands of classified tweets

πŸ“œ Course & Certification

This project was developed as part of the "Create Interactive Dashboards with Streamlit and Python" course on Coursera.

  • Learning Path: Data Analysis & Visualization
  • Duration: 2-hour hands-on project
  • Certification: View on Coursera

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is open source and available under the MIT License.


πŸ‘¨β€πŸ’» Author

Abdul Rehman

  • GitHub: @AbdulRehman393
  • LinkedIn: in/khawaja-abdul-rehman-24088b266
  • Portfolio: Check out my other projects on GitHub

πŸ™ Acknowledgments


πŸ“ž Support & Questions

If you have any questions or need assistance:

  • πŸ’¬ Open an Issue
  • πŸ“§ Feel free to reach out

About

Interactive Streamlit dashboard for analyzing customer sentiment from US Airlines Twitter data with real-time visualizations and geographic analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages