How zaeem-chaudry/twitter-sentiment-analysis-using-pyspark-in-big-data works
This repository is a PySpark Twitter sentiment-analysis application. Its primary workflow starts with a user-supplied CSV, cleans and weakly labels tweets, then reports sentiment counts and optionally saves labeled data or trains and evaluates a classifier. The README also documents an EMR/S3 analysis run, represented separately from the sampled CLI implementation. The source excerpts establish the CLI call flow and classifier internals; notebook internals were not sampled, so that documented capability is shown without inferred internal links.
Main entry points: run_pipeline.py Pipeline CLI · pipeline.py Distributed cleaning · train_classifier.py Classifier training · text_cleaning.py Text rules
Components 13
Input and orchestration
- Pipeline CLI
src/run_pipeline.py
Cleaning and labeling
- Distributed cleaning
src/pipeline.py - Text rules
src/text_cleaning.py - Sentiment labeling
src/pipeline.py
Analysis outputs
- Sentiment counts
src/run_pipeline.py - Labeled CSV output
src/run_pipeline.py - Exploratory analysis
notebooks/twitter_sentiment_analysis_emr.ipynb
Model training
- Classifier training
src/train_classifier.py - Evaluation metrics
src/train_classifier.py
Other components
- Analyst
- Tweet CSV
- TextBlob
- Amazon S3
Connections 11
- Analyst → Pipeline CLI: runs
src/run_pipeline.py - Tweet CSV → Pipeline CLI: reads
src/run_pipeline.py - Pipeline CLI → Distributed cleaning: calls
src/run_pipeline.py - Distributed cleaning → Text rules: uses
src/pipeline.py - Pipeline CLI → Sentiment labeling: calls
src/run_pipeline.py - Sentiment labeling → TextBlob: scores with
src/pipeline.py - Pipeline CLI → Sentiment counts: groups by
src/run_pipeline.py - Pipeline CLI → Labeled CSV output: writes
src/run_pipeline.py - Pipeline CLI → Classifier training: optionally trains
src/run_pipeline.py - Classifier training → Evaluation metrics: evaluates
src/train_classifier.py - Amazon S3 → Exploratory analysis: provides data
README.md