A comprehensive NLP application that analyzes Stranger Things content using custom-trained AI models with intelligent fallback to HuggingFace models.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Gradio App │────│ S3 Storage │────│ EC2 Training │
│ (User Interface│ │ (Trained Models) │ │ Instances │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
│ ┌────────┴────────┐ │
└──────────────│ HuggingFace Hub │───────────────┘
│ (Fallback Models)│
└─────────────────┘
├── gradio_app_v2.py # Main Gradio application with fallback announcements
├── training_pipeline.py # Model training and S3 upload pipeline
├── deploy_aws.py # AWS deployment orchestrator
├── config.py # Configuration settings
├── aws/ # AWS infrastructure management
│ ├── config.py # AWS configuration
│ ├── ec2_orchestrator.py # EC2 instance management
│ ├── ec2_manager.py # EC2 operations
│ └── storage.py # S3 storage management
├── data/
│ └── transcripts/ # Training data (10,924+ dialogue samples)
├── character_chatbot/ # Character chatbot implementations
├── theme_classifier/ # Theme classification module
├── character_network/ # Character relationship analysis
└── text_classification/ # Location classification module
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install gradio boto3 transformers torch pandas numpy python-dotenv \
nltk spacy scikit-learn matplotlib seaborn pyvis datasets \
evaluate peft accelerate trl
# Download spaCy model
python -m spacy download en_core_web_sm
# Download NLTK data
python -c "import nltk; nltk.download('punkt')"
# Configure AWS credentials
aws configure
# Set up environment variables
cp .env.example .env
# Edit .env with your HuggingFace token
# Run Gradio app locally (uses HuggingFace fallbacks initially)
source venv/bin/activate
python gradio_app_v2.py
# Initialize AWS infrastructure
python deploy_aws.py init
# Upload training data
python deploy_aws.py upload-data
# Train models (saves to S3 automatically)
python deploy_aws.py train llama
python deploy_aws.py train qwen
# Deploy production Gradio app
python deploy_aws.py deploy-gradio
# Monitor deployment
python deploy_aws.py status
Customize fallback behavior in config.py:
FALLBACK_CONFIG = {
"announce_fallback": True, # Enable/disable announcements
"fallback_message": "Notice: Using HuggingFace fallback for {model_type}"
}
# S3 model locations
S3_MODEL_PATHS = {
"llama": "models/trained/llama/",
"qwen": "models/trained/qwen/",
"location_classifier": "models/trained/location_classifier/"
}
# HuggingFace fallback models
FALLBACK_MODELS = {
"llama": "christopherxzyx/StrangerThings_Llama-3-8B_v3",
"qwen": "christopherxzyx/StrangerThings_Qwen-3-4B"
}
The system uses 10,924+ dialogue samples from Stranger Things transcripts:
name,line columnsdata/transcripts/*.csv# Train specific model locally using local transcripts
python training_pipeline.py --model-type llama --transcripts-dir data/transcripts
python training_pipeline.py --model-type qwen --transcripts-dir data/transcripts
# Or, train by downloading transcripts from S3 (useful for parity with EC2)
python training_pipeline.py --model-type llama --s3-transcripts data/transcripts/
python training_pipeline.py --model-type qwen --s3-transcripts data/transcripts/
# List running instances
python deploy_aws.py list-instances
# Check overall status
python deploy_aws.py status
# Terminate instance
python deploy_aws.py terminate <instance-id>
# Access training instance
ssh -i ~/.ssh/your-key.pem ubuntu@<instance-ip>
tail -f /home/ubuntu/stranger-things-nlp/training.log
# Access Gradio instance
ssh -i ~/.ssh/your-key.pem ubuntu@<instance-ip>
tail -f /home/ubuntu/stranger-things-nlp/gradio.log
tail -f training.log.env fileMIT License - see LICENSE file for details.
Interactive Character Chatbots from Netflix's Stranger Things
Link to trained models: https://huggingface.co/christopherxzyx
Complete Project Guide - Comprehensive documentation for setup, development, and deployment
AWS SageMaker Integration - Production-ready ML platform with scalable training and deployment
Problem: In the entertainment industry, especially with series like Stranger Things, fans often want to engage more deeply with their favorite characters like Eleven, Mike, or Dustin. However, merely watching the series or reading about it cannot provide the experience of direct interaction. The problem posed is:
Goals:
Main Idea: The solution leverages the power of NLP and LLM to analyze text data from Stranger Things, extract linguistic/personality traits of characters, and integrate them into a chatbot system capable of generating natural, in-character responses. The project combines modern tools such as Scrapy, SpaCy, Transformers, and Gradio to create a complete workflow from data collection to user interface deployment.
Proposed Method: The method is divided into key steps:
Technologies Used: Python: Primary programming language. Scrapy: For web data scraping. SpaCy: For text processing and linguistic analysis. Hugging Face Transformers: For LLM integration. Gradio: For the user interface.
Advantages of the Solution: High personalization: Chatbot accurately reflects the style of Stranger Things characters. Flexibility: Can be applied to multiple characters in the series. User-friendly: Gradio interface is intuitive and requires no technical knowledge from users.
# Setup environment
source venv/bin/activate
export huggingface_token="your_token_here"
# Run the application
python gradio_app.py
# Initialize AWS setup
source venv/bin/activate
python3 deploy_aws.py init
# Upload data and start training
python3 deploy_aws.py upload-data
python3 deploy_aws.py train llama
# Deploy publicly
python3 deploy_aws.py deploy-gradio
# Setup and deploy with SageMaker
cd sagemaker
# Build custom training container
cd docker && ./build_and_push.sh && cd ..
# Deploy infrastructure, train models, and create endpoints
python deploy.py --setup-infrastructure --train-all --deploy-all
# Launch SageMaker-enabled interface
python gradio_app.py
For detailed instructions, see PROJECT_GUIDE.md and SAGEMAKER_INTEGRATION.md
project/
├── PROJECT_GUIDE.md # Complete documentation
├── README.md # This file
├── SAGEMAKER_INTEGRATION.md # AWS SageMaker integration guide
├── WARP.md # Development guidelines
├── gradio_app.py # Main web interface
├── deploy_aws.py # AWS deployment CLI
├── aws_config.yaml # AWS configuration
├── requirements.txt # Dependencies
├── venv/ # Python environment
├── sagemaker/ # AWS SageMaker integration
├── aws/ # AWS infrastructure code
├── character_chatbot/ # Chatbot models
├── theme_classifier/ # Theme analysis
├── character_network/ # Network analysis
├── text_classification/ # Location classifier
├── utils/ # Utilities
├── data/ # Training data
└── stubs/ # Output results
55 commits
Python
50.4%
Jupyter Notebook
43.6%
HTML
4.8%
A comprehensive NLP application that analyzes Stranger Things content using custom-trained AI models with intelligent fallback to HuggingFace models.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Gradio App │────│ S3 Storage │────│ EC2 Training │
│ (User Interface│ │ (Trained Models) │ │ Instances │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
│ ┌────────┴────────┐ │
└──────────────│ HuggingFace Hub │───────────────┘
│ (Fallback Models)│
└─────────────────┘
├── gradio_app_v2.py # Main Gradio application with fallback announcements
├── training_pipeline.py # Model training and S3 upload pipeline
├── deploy_aws.py # AWS deployment orchestrator
├── config.py # Configuration settings
├── aws/ # AWS infrastructure management
│ ├── config.py # AWS configuration
│ ├── ec2_orchestrator.py # EC2 instance management
│ ├── ec2_manager.py # EC2 operations
│ └── storage.py # S3 storage management
├── data/
│ └── transcripts/ # Training data (10,924+ dialogue samples)
├── character_chatbot/ # Character chatbot implementations
├── theme_classifier/ # Theme classification module
├── character_network/ # Character relationship analysis
└── text_classification/ # Location classification module
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install gradio boto3 transformers torch pandas numpy python-dotenv \
nltk spacy scikit-learn matplotlib seaborn pyvis datasets \
evaluate peft accelerate trl
# Download spaCy model
python -m spacy download en_core_web_sm
# Download NLTK data
python -c "import nltk; nltk.download('punkt')"
# Configure AWS credentials
aws configure
# Set up environment variables
cp .env.example .env
# Edit .env with your HuggingFace token
# Run Gradio app locally (uses HuggingFace fallbacks initially)
source venv/bin/activate
python gradio_app_v2.py
# Initialize AWS infrastructure
python deploy_aws.py init
# Upload training data
python deploy_aws.py upload-data
# Train models (saves to S3 automatically)
python deploy_aws.py train llama
python deploy_aws.py train qwen
# Deploy production Gradio app
python deploy_aws.py deploy-gradio
# Monitor deployment
python deploy_aws.py status
Customize fallback behavior in config.py:
FALLBACK_CONFIG = {
"announce_fallback": True, # Enable/disable announcements
"fallback_message": "Notice: Using HuggingFace fallback for {model_type}"
}
# S3 model locations
S3_MODEL_PATHS = {
"llama": "models/trained/llama/",
"qwen": "models/trained/qwen/",
"location_classifier": "models/trained/location_classifier/"
}
# HuggingFace fallback models
FALLBACK_MODELS = {
"llama": "christopherxzyx/StrangerThings_Llama-3-8B_v3",
"qwen": "christopherxzyx/StrangerThings_Qwen-3-4B"
}
The system uses 10,924+ dialogue samples from Stranger Things transcripts:
name,line columnsdata/transcripts/*.csv# Train specific model locally using local transcripts
python training_pipeline.py --model-type llama --transcripts-dir data/transcripts
python training_pipeline.py --model-type qwen --transcripts-dir data/transcripts
# Or, train by downloading transcripts from S3 (useful for parity with EC2)
python training_pipeline.py --model-type llama --s3-transcripts data/transcripts/
python training_pipeline.py --model-type qwen --s3-transcripts data/transcripts/
# List running instances
python deploy_aws.py list-instances
# Check overall status
python deploy_aws.py status
# Terminate instance
python deploy_aws.py terminate <instance-id>
# Access training instance
ssh -i ~/.ssh/your-key.pem ubuntu@<instance-ip>
tail -f /home/ubuntu/stranger-things-nlp/training.log
# Access Gradio instance
ssh -i ~/.ssh/your-key.pem ubuntu@<instance-ip>
tail -f /home/ubuntu/stranger-things-nlp/gradio.log
tail -f training.log.env fileMIT License - see LICENSE file for details.
Interactive Character Chatbots from Netflix's Stranger Things
Link to trained models: https://huggingface.co/christopherxzyx
Complete Project Guide - Comprehensive documentation for setup, development, and deployment
AWS SageMaker Integration - Production-ready ML platform with scalable training and deployment
Problem: In the entertainment industry, especially with series like Stranger Things, fans often want to engage more deeply with their favorite characters like Eleven, Mike, or Dustin. However, merely watching the series or reading about it cannot provide the experience of direct interaction. The problem posed is:
Goals:
Main Idea: The solution leverages the power of NLP and LLM to analyze text data from Stranger Things, extract linguistic/personality traits of characters, and integrate them into a chatbot system capable of generating natural, in-character responses. The project combines modern tools such as Scrapy, SpaCy, Transformers, and Gradio to create a complete workflow from data collection to user interface deployment.
Proposed Method: The method is divided into key steps:
Technologies Used: Python: Primary programming language. Scrapy: For web data scraping. SpaCy: For text processing and linguistic analysis. Hugging Face Transformers: For LLM integration. Gradio: For the user interface.
Advantages of the Solution: High personalization: Chatbot accurately reflects the style of Stranger Things characters. Flexibility: Can be applied to multiple characters in the series. User-friendly: Gradio interface is intuitive and requires no technical knowledge from users.
# Setup environment
source venv/bin/activate
export huggingface_token="your_token_here"
# Run the application
python gradio_app.py
# Initialize AWS setup
source venv/bin/activate
python3 deploy_aws.py init
# Upload data and start training
python3 deploy_aws.py upload-data
python3 deploy_aws.py train llama
# Deploy publicly
python3 deploy_aws.py deploy-gradio
# Setup and deploy with SageMaker
cd sagemaker
# Build custom training container
cd docker && ./build_and_push.sh && cd ..
# Deploy infrastructure, train models, and create endpoints
python deploy.py --setup-infrastructure --train-all --deploy-all
# Launch SageMaker-enabled interface
python gradio_app.py
For detailed instructions, see PROJECT_GUIDE.md and SAGEMAKER_INTEGRATION.md
project/
├── PROJECT_GUIDE.md # Complete documentation
├── README.md # This file
├── SAGEMAKER_INTEGRATION.md # AWS SageMaker integration guide
├── WARP.md # Development guidelines
├── gradio_app.py # Main web interface
├── deploy_aws.py # AWS deployment CLI
├── aws_config.yaml # AWS configuration
├── requirements.txt # Dependencies
├── venv/ # Python environment
├── sagemaker/ # AWS SageMaker integration
├── aws/ # AWS infrastructure code
├── character_chatbot/ # Chatbot models
├── theme_classifier/ # Theme analysis
├── character_network/ # Network analysis
├── text_classification/ # Location classifier
├── utils/ # Utilities
├── data/ # Training data
└── stubs/ # Output results
55 commits
Python
50.4%
Jupyter Notebook
43.6%
HTML
4.8%