This project is an interactive data visualization dashboard built with Python and Streamlit to explore the sentiment of tweets related to major US airlines.
The application analyzes Twitter data and provides interactive visualizations to help users understand how people feel about different airlines. Users can explore tweet sentiments, visualize tweet distribution, view tweet locations on a map, and generate word clouds from tweet text.
The dashboard is deployed using Streamlit Community Cloud, allowing users to interact with the application directly from their browser.
Social media platforms like Twitter provide valuable insights into customer opinions and experiences. This project analyzes tweets related to US airlines and classifies them into three sentiment categories:
- Positive
- Neutral
- Negative
Using Streamlit, the project converts a Python data analysis workflow into a fully interactive web application. Users can dynamically explore the dataset through different visualization components such as charts, maps, and word clouds.
The application loads tweet data, processes timestamps, and enables interactive filtering to provide a deeper understanding of customer sentiment toward different airlines.
This project uses the Twitter US Airline Sentiment Dataset available on Kaggle.
The dataset contains tweets directed at major US airlines along with sentiment labels.
Key fields used in this project include:
airline– Name of the airline mentioned in the tweetairline_sentiment– Sentiment classification (positive, neutral, negative)text– The tweet contenttweet_created– Timestamp of when the tweet was postedtweet coordinates/ location data – Used for mapping tweets geographically
The Streamlit dashboard provides multiple interactive components to analyze tweet sentiment.
Users can select a sentiment type and view a random tweet from that category. This feature allows quick inspection of actual tweets classified as positive, neutral, or negative. The tweet is selected using a filtered query on the dataset and displayed in the sidebar.
The dashboard shows how tweets are distributed across different sentiment categories. Users can choose between two visualization types:
- Histogram (Bar Chart)
- Pie Chart
These visualizations are created using Plotly Express, allowing interactive exploration of the sentiment distribution.
Users can explore where tweets were posted from at different times of the day. Features include:
- Hour-of-day slider
- Map visualization of tweet locations
- Option to view raw filtered data
The application filters tweets based on the selected hour and plots them on an interactive map using Streamlit’s st.map() function.
This helps identify when and where users are tweeting about airlines.
Users can select one or multiple airlines to compare how sentiments vary across airlines. Supported airlines include:
- US Airways
- United
- American
- Southwest
- Delta
- Virgin America
The dashboard generates a faceted histogram showing the number of tweets by sentiment for each selected airline.
The visualization helps answer questions like:
- Which airline receives the most negative tweets?
- Which airlines have the most positive feedback?
The application can generate word clouds for tweets based on sentiment categories.
Users can select:
- Positive tweets
- Neutral tweets
- Negative tweets
The system processes tweet text and removes:
- URLs
- Mentions (
@username) - Retweet indicators (
RT)
Then a word cloud is generated using the WordCloud library to visualize the most frequently used words. This helps identify common topics and issues discussed in tweets.
- Programming Language: Python
- Framework: Streamlit
- Data Processing: Pandas, NumPy
- Visualization: Plotly Express, Matplotlib
- Text Visualization: WordCloud
Airline-Tweet-Sentiment-Dashboard
│
├── app.py
├── requirements.txt
├── dataset
│ └── Tweets.csv
└── README.md
The main Streamlit application that handles:
- Data loading
- Interactive UI elements
- Visualizations
- Word cloud generation
Contains the list of Python dependencies required to run the project.
The dataset containing tweets related to US airlines used for sentiment analysis.
The dataset is loaded using a cached function to improve performance:
- Reads CSV file
- Converts
tweet_createdcolumn to datetime format - Caches the data using
st.cache_data()
This ensures the dataset is not reloaded every time the user interacts with the dashboard.
The sidebar provides controls for interacting with the dashboard:
- Sentiment selector for random tweets
- Visualization type selection
- Hour-of-day slider
- Airline multi-selection
- Word cloud sentiment selector
These controls dynamically update the visualizations in real time.
1. Clone the Repository
git clone https://github.com/Avik-Das-567/Airline-Tweet-Sentiment-Dashboard.git
2. Navigate to the Project Directory
cd Airline-Tweet-Sentiment-Dashboard
3. Install Dependencies
Install the required Python packages using:
pip install -r requirements.txt
4. Run the streamlit application:
streamlit run app.py
Streamlit will automatically launch the app at:
http://localhost:8501
- Converts a Python data analysis script into a full web application.
- Uses interactive Streamlit widgets for dynamic filtering.
- Provides multiple visualization techniques including charts and maps.
- Generates word clouds for text analysis.
- Demonstrates end-to-end data exploration workflow.