Interactive Data Visualization & Sentiment Analysis Platform for US Airlines Twitter Data
π Try the Live Application Here!
The application is now deployed and live. Click the link above to explore the interactive dashboard!
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.
-
π 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
Overview of tweet distribution across positive, neutral, and negative sentiments with interactive histogram and pie chart options
Interactive map showing tweet locations filtered by time of day for pattern identification
Detailed comparison of sentiment distribution across different airlines with faceted visualizations
Dynamic word cloud visualization highlighting the most frequent terms in each sentiment category
- Python 3.8 or higher
- pip (Python package manager)
-
Clone the repository
git clone https://github.com/AbdulRehman393/streamlit-airline-sentiment.git cd streamlit-airline-sentiment -
Install dependencies
pip install -r requirements.txt
-
Run the application locally
streamlit run app.py
-
View in browser
- Streamlit will automatically open your browser to
http://localhost:8501 - If not, manually navigate to that URL
- Streamlit will automatically open your browser to
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
| 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 |
- Data Loading: CSV file is loaded from GitHub and cached using Streamlit's
@st.cache_datadecorator - Timestamp Parsing: Tweet creation times are converted to datetime format
- Sentiment Analysis: Data is pre-classified as positive, neutral, or negative
- Visualization: Multiple visualization types transform data into actionable insights
- 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
- 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
This project is deployed on Streamlit Cloud and is live at:
https://app-airline-sentiment-8mwwconsnxvhqrfy6yhicz.streamlit.app/
To deploy your own version:
- Push your code to GitHub
- Visit Streamlit Cloud
- Sign up with your GitHub account
- Click "New app"
- Select your repository:
AbdulRehman393/streamlit-airline-sentiment - Set main file to
app.py - Click "Deploy"
Update the DATA_URL variable in app.py:
DATA_URL = "https://raw.githubusercontent.com/your-username/your-repo/main/data/Tweets.csv"Edit the airline selection in the sidebar:
choice = st.sidebar.multiselect('Pick Airlines',
('Your Airlines Here'), key = 'airline_selection')Customize Plotly and Matplotlib settings for different color schemes, sizes, and styles.
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
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
Contributions, issues, and feature requests are welcome! Feel free to:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
Abdul Rehman
- GitHub: @AbdulRehman393
- LinkedIn: in/khawaja-abdul-rehman-24088b266
- Portfolio: Check out my other projects on GitHub
- Data sourced from Twitter (now X) API
- Dashboard built with Streamlit
- Visualizations powered by Plotly and Matplotlib
- Course: Create Interactive Dashboards with Streamlit and Python
If you have any questions or need assistance:
- π¬ Open an Issue
- π§ Feel free to reach out
Made with β€οΈ by Abdul Rehman