Skip to content

feat: ML-based Intent Detection + Affection Point System with Comprehensive Logging#32

Merged
Afdaan merged 6 commits into
masterfrom
development
Oct 21, 2025
Merged

feat: ML-based Intent Detection + Affection Point System with Comprehensive Logging#32
Afdaan merged 6 commits into
masterfrom
development

Conversation

@Afdaan
Copy link
Copy Markdown
Owner

@Afdaan Afdaan commented Oct 21, 2025

🎯 Changes

1. ML-Based Intent Detection (Replace Hardcoded Keywords)

  • ✅ Integrated MoritzLaurer/mDeBERTa-v3-base-mnli-xnli untuk zero-shot classification
  • ✅ Support bilingual labels (Indonesian + English)
  • ✅ Intent caching untuk performance optimization
  • ✅ 78% accuracy (11/14 test cases passed)
  • ❌ Removed hardcoded regex patterns untuk intent detection

2. Affection Point System

  • ✅ Intent → Affection Points mapping (gratitude +5, insult -10, etc.)
  • ✅ Emotion → Affection modifier (joy +2, anger -3)
  • ✅ Relationship signals (friendliness, conflict) untuk context-aware scoring
  • ✅ Auto-calculate relationship level dari affection_points + interaction_count
  • ✅ Database persistence via update_affection() method

3. Comprehensive Logging

  • ✅ INFO level: Production tracking (affection updates, level changes)
  • ✅ DEBUG level: Detailed breakdown (signal calculation, confidence scores)
  • ✅ Full traceability dari NLP detection → affection calculation → database save

4. Stats Display Refactor

  • ❌ Removed unused positive_interactions / negative_interactions counters
  • ✅ Simplified stats output focus pada affection_points dan relationship_level
  • ✅ Cleaner, more meaningful user stats display

📊 Files Changed

  • config/settings.py - Added zero-shot model config
  • core/nlp.py - Implemented ML-based intent detection + logging
  • handlers/conversation.py - Enhanced affection calculation + logging
  • handlers/response/stats.py - Removed duplicate tracking, simplified output

@Afdaan Afdaan merged commit 1329107 into master Oct 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant