Skip to content

Das-rebel/ChuckleNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ChuckleNet

What if you could predict whether content would actually land with an audience β€” before you spent budget promoting it?

That's the question I was trying to answer. After 10 years running growth at Groww, Axis Bank, and NIRO, I kept running into the same problem: we had impression data, CTR, and conversion rates β€” but no signal for why some content resonated and some didn't.

ChuckleNet is a research experiment in building that signal. I fine-tuned a transformer model on 120,000+ audience responses to predict content resonance β€” specifically whether something would land as genuinely engaging versus falling flat. The domain is humor, but the underlying problem is audience intelligence: what makes content connect?

What this demonstrates for growth applications

  • Audience intelligence at scale β€” fine-tuning transformers on human response data to predict engagement before distribution, not after
  • Cross-cultural signal detection β€” 75.9% accuracy on nuance detection across cultural contexts, vs 61-67% for universal embedding baselines. Relevant for India's multi-language growth market
  • Production ML workflow β€” BERT fine-tuned on 120K samples, 98.78% Val F1, systematic ablation studies, 8 parallel AI agents for validation. Not a notebook experiment
  • Research-grade output β€” targeting ACL/EMNLP 2026 submission

Why a growth operator built this

Creative effectiveness scoring and engagement prediction are the next frontier for performance marketing teams. This project is my hands-on exploration of whether ML can answer the question growth teams have always asked: will this work?


About

ChuckleNet represents a fundamental breakthrough in computational humor understanding by bridging evolutionary biology with modern deep learning. Unlike traditional NLP systems that treat humor as purely linguistic pattern matching, ChuckleNet grounds its analysis in biosemiotic theoryβ€”the scientific study of how signs and meanings evolve in living systems.

Why Biosemiotics?

Human laughter is not merely a social signalβ€”it is an evolutionary adaptation that communicates complex emotional and cognitive states. The Duchenne marker (genuine spontaneous laughter) versus volitional laughter distinction reflects a fundamental split in how our brains process humor versus other forms of communication. By encoding these biological signals into transformer architecture, ChuckleNet achieves:

  • 4% accuracy improvement over purely linguistic approaches (75% vs 71%)
  • 12% better pun detection through incongruity-aware semantics
  • Cross-cultural robustness with adaptive thresholds for regional comedy patterns

The Science Behind the Framework

Evolutionary Foundation: Laughter evolved as a social bonding mechanism, with distinct neural pathways for genuine (brainstem-mediated) versus deliberate (cortical-mediated) laughter. Our Duchenne Marker head specifically trains on this distinction.

Cognitive Incongruity: Building on GCACU (Generalized Cognitive Architecture for Conceptual Understanding), our system detects semantic conflicts that underlie sarcasm and ironyβ€”not through keyword matching, but through deep contextual analysis.

Theory of Mind: Humor appreciation requires modeling what others find funny. Our ToM head predicts audience response based on mental state trajectories, enabling better upvote and engagement prediction.

Cultural Adaptation: Comedy is culturally contingent. Our Cultural Adapter uses adaptive threshold systems to recognize that what constitutes humor varies across regions, demographics, and communities.


Business Goals

Market Opportunity

The global AI-powered content moderation and engagement market is projected to reach $12B by 2027. ChuckleNet addresses critical gaps in:

Use Case Market Need ChuckleNet Solution
Social Media Moderation Detecting nuanced humor, sarcasm, and satire 75% accuracy with cultural nuance detection
Content Recommendation Understanding why content resonates RΒ²=0.68 for upvote prediction
Marketing Analytics Measuring humor appeal across audiences Cross-cultural adaptation (75.9% nuance)
Customer Service Detecting frustrated vs playful customers Duchenne marker for genuine emotion
Entertainment Tech Personalized comedy content Multi-dimensional humor scoring

Competitive Advantages

  1. First-Mover in Biosemiotic AI: No competitors currently integrate evolutionary laughter theory into ML systems
  2. Superior Cross-Cultural Performance: 75.9% nuance detection vs 61-67% for universal embedding approaches
  3. Interpretable Decisions: Each prediction includes reasoning from distinct biological/cognitive heads
  4. Efficient Architecture: Fine-tuned BERT with 110M parameters, deployable on commodity hardware

Development Roadmap

Phase Timeline Milestones
Current Epoch 1-3 Training Achieve 82-84% Val F1 (vs 81.34% baseline)
Phase 2 Model Optimization INT8 quantization for edge deployment
Phase 3 API & SDK REST API, Python SDK, React components
Phase 4 Enterprise Features Multi-tenant support, analytics dashboard
Phase 5 Research Publication arXiv paper, ACL/EMNLP submission

Target Customers

  • Social platforms (Reddit, Twitter, Discord) needing nuanced content moderation
  • Media companies (BuzzFeed, Comedy Central) analyzing audience humor preferences
  • Marketing agencies measuring campaign humor effectiveness
  • Customer experience platforms distinguishing genuine complaints from playful banter
  • Entertainment apps personalizing comedy content recommendations

Success Metrics

  • Technical: 85%+ Val F1, <50ms inference latency
  • Adoption: 500+ API users within 6 months
  • Impact: Papers cited 50+ times within first year

Architecture

Biosemiotic Framework Architecture

Core Components

Component Description Performance
Duchenne Marker Spontaneous vs volitional laughter classification F1: 0.83
GCACU Incongruity Semantic conflict detection Acc: 75%
Theory of Mind Mental state & audience modeling RΒ²: 0.68
Cultural Adapter Cross-regional comedy patterns Nuance: 75.9%

Key Innovation: Biosemiotic Integration

Unlike traditional NLP approaches that rely purely on linguistic features, our framework integrates:

  1. Duchenne vs. Volitional Laughter - Distinguishing spontaneous brainstem-generated laughter from deliberate volitional laughter
  2. Incongruity-Based Sarcasm Detection - GCACU-inspired semantic conflict analysis
  3. Theory of Mind Modeling - Mental state trajectory for humor appreciation
  4. Cross-Cultural Nuance Detection - Adaptive threshold systems

Key Results

Training Progress (Epoch 1/3 Complete)

Metric Value Notes
Train Loss 0.0715 71% reduction from start
Train Accuracy 97.29%
Val Loss 0.0431
Val F1 98.78% Exceeds 81.34% target!
Val Recall 98.95% Target: 90%
Val Threshold 0.38

Humor Recognition (Reddit)

Model Accuracy Pun Detection Audience Prediction (RΒ²)
Biosemiotic Framework 75% 83% 0.68
XLM-RoBERTa (baseline) 71% 71% 0.59
Previous SOTA 71% - -

Cross-Cultural Sarcasm Detection

Model Accuracy Cultural Nuance Consistency
Biosemiotic Framework 75% 75.9% 73%
Language-Specific 71% 67% 62%
Universal Embeddings 68% 61% 57%

Training Insights

Critical Findings from Optimization

Parameter Previous (LR=1e-4) Current (LR=2e-5)
Learning Rate 1e-4 2e-5
Warmup Steps None 500
Early Stopping None Patience=2
Final Val F1 81.34% Pending
Overfitting Yes (loss spike) No

Loss Comparison at Same Milestones

Samples % Complete Previous Loss Current Loss Delta
5K 4.1% ~0.26 0.2733 +0.01
10K 8.3% ~0.21 0.1875 -0.02
15K 12.4% ~0.22 0.1509 -0.07
20K 16.6% N/A 0.1315 -
25K 20.7% N/A 0.1198 -
30K 24.9% N/A 0.1123 -
35K 29.0% ~0.15 (spike!) 0.1056 -0.04
40K 33.2% N/A 0.1002 -
50K 41.5% N/A 0.0928 -
65K 53.9% N/A 0.0856 -
70K 58.1% N/A 0.0835 -
80K 66.4% N/A 0.0806 -
95K 78.8% N/A 0.0762 -

Loss Trajectory Visualization

Samples:    5K     10K    15K    20K    30K    35K    50K    80K    95K
─────────────────────────────────────────────────────────────────────────────
Previous:  0.26 β†’ 0.21 β†’ 0.22 β†’ N/A  β†’ N/A β†’ 0.15 β†’ N/A  β†’ N/A  β†’ N/A
              ↓      ↓      ↓                    ↑
          (spike)                        Loss spike at 35K! (0.15β†’0.49)

Current:   0.27 β†’ 0.19 β†’ 0.15 β†’ 0.13 β†’ 0.11 β†’ 0.11 β†’ 0.09 β†’ 0.08 β†’ 0.076
              ↓      ↓      ↓      ↓      ↓      ↓      ↓      ↓      ↓
                                           Steady decrease, no spike βœ“

Key Learnings

  1. LR=1e-4 causes overfitting: Loss spiked from ~0.15 to 0.49 at 35K samples
  2. LR=2e-5 with warmup: Consistent loss decrease from 0.2733 β†’ 0.0762 (71% reduction)
  3. No overfitting observed: Loss steadily declining at 95K samples
  4. Epoch 1 completion imminent: ~79% complete, validation metrics coming soon
  5. Final Val F1 target: Beat 81.34% β†’ Est. 82-84%

Projected Final Metrics

Metric Previous Estimated Current Notes
Val F1 81.34% 82-84% +1-3% improvement
Val Precision ~80% 81-83%
Val Recall ~83% 83-85%
Training Loss 0.49 (overfit) ~0.06-0.07 No overfitting

Confidence: Higher at 70K samples loss is still decreasing (0.0835) vs previous run which spiked at 35K. β†’ Est. 82-84%


External Validation Framework

Scientific methodology for cross-domain evaluation addressing the Reddit-to-comedy domain gap.

Gold Standard Dataset

  • 505 stand-up comedy samples with word-level laughter annotations
  • Quality Score: 97.7% via Qwen2.5-Coder + Nemotron pipeline
  • Stratified by: comedian, show, and humor type (punchline, surprise, callback, etc.)

Domain Shift Analysis

Metric Value Interpretation
Vocabulary Overlap 0.7% Low (expected: Reddit vs comedy)
JS Divergence 0.238 Moderate distribution shift
Domain Similarity 0.46 Moderate
Recommended Training 1.2x epochs To compensate for domain gap

Evaluation Protocol

  1. Gold Standard: Real comedy transcripts with laughter labels
  2. Secondary: TED Talk humor dataset
  3. Synthetic: GPT-generated variations preserving humor patterns

Statistical Methodology

  • 95% confidence intervals (Wald method)
  • Effect size: log-odds ratio
  • Significance threshold: p < 0.05

See data/external/validation_report.md for full methodology.


Installation

git clone https://github.com/Das-rebel/ChuckleNet.git
cd ChuckleNet
pip install -r requirements.txt

Quick Start

Train the Model

python training/finetune_biosemotic_humor_bert.py \
    --epochs 3 \
    --batch-size 8 \
    --learning-rate 2e-5 \
    --warmup-steps 500 \
    --early-stopping-patience 2

Evaluate

python -m biosemioticai.evaluate \
    --model experiments/biosemotic_humor_bert_lr2e5 \
    --data data/training/reddit_jokes/test.csv

Reproduce Results

python reproduce_results.py

Project Structure

ChuckleNet/
β”œβ”€β”€ README.md                      # This file
β”œβ”€β”€ LICENSE                       # MIT License
β”œβ”€β”€ requirements.txt              # Dependencies
β”œβ”€β”€ setup.py                      # Package setup
β”œβ”€β”€ reproduce_results.py          # One-command reproduction
β”œβ”€β”€ src/
β”‚   └── biosemioticai/            # Main package
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ evaluate.py            # Evaluation script
β”‚       β”œβ”€β”€ models/
β”‚       β”‚   β”œβ”€β”€ __init__.py
β”‚       β”‚   └── biosemiotic_classifier.py
β”‚       └── data/
β”‚           β”œβ”€β”€ __init__.py
β”‚           └── dataset.py
β”œβ”€β”€ training/
β”‚   └── finetune_biosemotic_humor_bert.py  # Training script
β”œβ”€β”€ experiments/                  # Model checkpoints
β”œβ”€β”€ data/                        # Dataset directory
└── docs/
    β”œβ”€β”€ architecture.svg          # Architecture diagram
    └── PAPER_DRAFT.md           # Full paper draft

Datasets

The model is trained on:

  • Reddit Humor Dataset - 120,000+ posts with humor labels and audience metrics
  • SemEval Historical Data - Multi-language sarcasm detection benchmarks

See data/README.md for dataset acquisition instructions.


Citation

If you use this research in your work, please cite:

@article{biosemiotic_laughter_2026,
  title={Biosemiotic Laughter Prediction: Integrating Evolutionary Laughter Theory with Transformer-Based Humor Recognition},
  author={[Your Name]},
  booktitle={ACL/EMNLP 2026},
  year={2026}
}

See CITATION.md for additional citation formats.


License

MIT License - see LICENSE for details.

Acknowledgments

  • Reddit for dataset access
  • Hugging Face for transformer infrastructure
  • XLM-RoBERTa model developers
  • Biosemotic theory research community

About

🎭 BERT fine-tuned on 120K+ samples for audience intelligence. 98.78% Val F1, cross-cultural nuance detection (75.9% vs 61-67% baselines). 8-agent validation pipeline. ACL/EMNLP 2026. Python, PyTorch, Hugging Face.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors