You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
๐ซ Big Data Pipeline โ Airline Tweet Sentiment Analysis
๐ Overview
This project implements a complete Big Data processing pipeline using Apache Spark and MongoDB to ingest, process, analyze, and visualize large-scale Twitter data about US airline sentiment.
The pipeline covers:
โ Data ingestion and cleaning using PySpark
โ NoSQL storage in MongoDB with optimized schema and indexing
โ Large-scale data analysis using Spark transformations
โ Complex querying using Spark SQL
โ Performance comparison between Spark SQL and MongoDB Aggregation
โ Data visualization using Matplotlib and Seaborn
โ BONUS โ Interactive dashboard using Streamlit
โ BONUS โ Format comparison: CSV vs Parquet vs Avro
๐ฅ Team Members
Member
Responsibility
Rabaya Khatun Keya
Data ingestion, cleaning & MongoDB storage
Manasha Siriwardana Mudalige Don
Spark processing & transformations
Md Firoz Chowdhury
MongoDB queries & indexing
Neeru Neeru
Spark SQL queries & performance analysis, Visualization, report, dashboard & documentation also git process
๐ Dataset
Detail
Info
Name
Twitter US Airline Sentiment
Source
Kaggle
Records
~14.6k raw tweets; 14,478 records after cleaning
Airlines
United, US Airways, American, Southwest, Delta, Virgin America
Users should update JAVA_HOME and PYSPARK_PYTHON according to their own system before running the notebooks. Local file paths may differ across team members' computers, so paths should be adjusted if needed.
Step 4 โ Start MongoDB
net start MongoDB
Step 5 โ Launch Jupyter
conda activate pyspark_env
jupyter notebook
๐ How to Run
Main Notebooks โ Run in Order
Order
Notebook
Description
1st
01_data_ingestion.ipynb
Load CSV โ clean โ store in MongoDB
2nd
02_spark_processing.ipynb
Spark transformations & analysis
3rd
03_mongodb_queries.ipynb
MongoDB aggregation queries
4th
04_spark_sql_queries.ipynb
Spark SQL & performance comparison
5th
05_visualization.ipynb
Generate all charts
6th
06_format_comparison.ipynb
CSV vs Parquet vs Avro (Google Colab)
โ Recommended Execution Order
For best results, the notebooks should be run in the listed order because later steps depend on the cleaned data, MongoDB collection, and outputs generated in earlier notebooks.
Streamlit Dashboard (Bonus)
conda activate pyspark_env
python -m streamlit run app.py
Open browser at: http://localhost:8501
๐๏ธ MongoDB Schema
Database: tweets_db
Collection: airline_tweets
Fields:
tweet_id String
airline_sentiment String (positive / neutral / negative)
airline_sentiment_confidence Float
negativereason String (nullable)
airline String
retweet_count Integer
text String
clean_text String
tweet_created String
tweet_location String (nullable)
Indexes (6 total):
airline Single field
airline_sentiment Single field
negativereason Single field
tweet_id Single field
airline + airline_sentiment Compound
๐ Key Findings
Sentiment Distribution
Sentiment
Count
Percentage
Negative
9,110
63%
Neutral
3,069
21%
Positive
2,299
16%
Airline Rankings
Rank
Airline
Negative
Positive
1 (Worst)
United
2,630
492
2
US Airways
2,263
269
3
American
1,863
307
4
Southwest
1,185
570
5
Delta
953
544
6 (Best)
Virgin America
181
152
Top Complaint Reasons
Rank
Reason
Count
1
Customer Service Issue
2,883
2
Late Flight
1,648
3
Can't Tell
1,175
4
Cancelled Flight
829
5
Lost Luggage
717
โก Performance Comparison
Spark SQL vs MongoDB
Tool
Best For
MongoDB
Simple aggregations with indexed fields
Spark SQL
Complex multi-column analytical queries
Format Comparison โ Bonus (Google Colab / Linux)
Format
Write Speed
Read Speed
File Size
Best For
CSV
Slowest
Slowest
Largest
Human readable, compatibility
Parquet
Medium
Fastest
Smallest
Analytics, fast reads
Avro
Fast
Medium
Medium
Streaming, schema evolution
๐ฏ Bonus Features Completed
โ Bonus 1 โ Interactive Streamlit Dashboard
Live connection to MongoDB
Sidebar filters by airline and sentiment
Interactive pie chart, bar charts, heatmap
Airline scorecard table with positive/negative percentages
Raw data viewer with 100 tweets
Run with: python -m streamlit run app.py
โ Bonus 2 โ Format Comparison (CSV vs Parquet vs Avro)