Dashboard Features: - 8 navigation sections: Overview, Outcomes, Poor CX, FCR, Churn, Agent, Call Explorer, Export - Beyond Brand Identity styling (colors #6D84E3, Outfit font) - RCA Sankey diagram (Driver → Outcome → Churn Risk flow) - Correlation heatmaps (driver co-occurrence, driver-outcome) - Outcome Deep Dive (root causes, correlation, duration analysis) - Export functionality (Excel, HTML, JSON) Blueprint Compliance: - FCR: 4 categories (Primera Llamada/Rellamada × Sin/Con Riesgo de Fuga) - Churn: Binary view (Sin Riesgo de Fuga / En Riesgo de Fuga) - Agent: Talento Para Replicar / Oportunidades de Mejora - Fixed FCR rate calculation (only FIRST_CALL counts as success) Technical: - Streamlit + Plotly for interactive visualizations - Light theme configuration (.streamlit/config.toml) - Fixed Plotly colorbar titlefont deprecation Documentation: - Updated PROJECT_CONTEXT.md, TODO.md, CHANGELOG.md - Added 4 new technical decisions (TD-014 to TD-017) - Created TROUBLESHOOTING.md with 10 common issues Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4.6 KiB
4.6 KiB
MODULE_GUIDES.md
Guía de implementación para cada módulo
Guía: Transcription Module
Archivos involucrados
src/transcription/
├── __init__.py
├── base.py # Interface Transcriber + MockTranscriber
├── assemblyai.py # AssemblyAITranscriber
└── models.py # Transcript, SpeakerTurn, TranscriptMetadata
Cómo funciona
- Audio file entra al transcriber
- AssemblyAI procesa con diarización (agent/customer)
- Retorna
TranscriptconSpeakerTurn[]y metadata
Cómo testear
pytest tests/unit/test_transcription.py -v
Cómo extender
- Para nuevo provider: implementar
Transcriberinterface - Para modificar output: editar
models.py
Troubleshooting
- "API key invalid" → Check
.envASSEMBLYAI_API_KEY - "Audio format not supported" → Convert to MP3/WAV
Guía: Feature Extraction Module
Archivos involucrados
src/features/
├── __init__.py
├── event_detector.py # HOLD, TRANSFER, SILENCE detection
└── turn_metrics.py # Talk ratio, interruptions
Cómo funciona
- Transcript entra
- Regex + reglas detectan eventos (HOLD, TRANSFER, etc.)
- Métricas calculadas (talk ratio, speaking time)
- Transcript enriquecido con
detected_events[]
Eventos soportados
HOLD_START/HOLD_ENDTRANSFERESCALATIONSILENCE(> umbral)INTERRUPTION
Cómo testear
pytest tests/unit/test_features.py -v
Guía: Compression Module
Archivos involucrados
src/compression/
├── __init__.py
├── compressor.py # TranscriptCompressor
└── models.py # CompressedTranscript, CustomerIntent, etc.
Cómo funciona
- Transcript completo entra
- Regex español extrae:
- Customer intents (cancelar, consultar)
- Agent offers (descuento, upgrade)
- Objections (precio, competencia)
- Resolutions
- Genera
CompressedTranscriptcon >60% reducción
Patrones español
INTENT_PATTERNS = {
IntentType.CANCEL: [r"quiero\s+cancelar", r"dar\s+de\s+baja"],
IntentType.INQUIRY: [r"quería\s+saber", r"información\s+sobre"],
}
Cómo testear
pytest tests/unit/test_compression.py -v
Guía: Inference Module
Archivos involucrados
src/inference/
├── __init__.py
├── analyzer.py # CallAnalyzer (main class)
├── llm_client.py # OpenAIClient
└── prompts.py # Spanish MAP prompt
Cómo funciona
- CompressedTranscript entra
- Prompt construido con taxonomía + transcript
- LLM genera JSON con:
outcomelost_sales_drivers[]con evidencepoor_cx_drivers[]con evidence
- Response parseada a
CallAnalysis
Configuración
AnalyzerConfig(
model="gpt-4o-mini",
use_compression=True,
max_concurrent=5,
)
Cómo testear
pytest tests/unit/test_inference.py -v
Guía: Aggregation Module
Archivos involucrados
src/aggregation/
├── __init__.py
├── statistics.py # StatisticsCalculator
├── severity.py # SeverityCalculator
├── rca_tree.py # RCATreeBuilder
└── models.py # DriverFrequency, RCATree, etc.
Cómo funciona
- List[CallAnalysis] entra
- Statistics: frecuencias por driver
- Severity: puntuación ponderada
- RCA Tree: árbol jerárquico ordenado
Fórmula de severidad
severity = (
base_severity * 0.4 +
frequency_factor * 0.3 +
confidence_factor * 0.2 +
co_occurrence_factor * 0.1
) * 100
Cómo testear
pytest tests/unit/test_aggregation.py -v
Guía: Pipeline Module
Archivos involucrados
src/pipeline/
├── __init__.py
├── models.py # PipelineManifest, StageManifest, Config
└── pipeline.py # CXInsightsPipeline
Stages
- TRANSCRIPTION
- FEATURE_EXTRACTION
- COMPRESSION
- INFERENCE
- AGGREGATION
- EXPORT
Resume
- Manifest JSON guardado por batch
get_resume_stage()detecta dónde continuar
Cómo testear
pytest tests/unit/test_pipeline.py -v
Guía: Exports Module
Archivos involucrados
src/exports/
├── __init__.py
├── json_export.py # Summary + analyses
├── excel_export.py # Multi-sheet workbook
└── pdf_export.py # HTML executive report
Formatos
- JSON:
summary.json+analyses/*.json - Excel: 5 sheets (Summary, Lost Sales, Poor CX, Details, Patterns)
- PDF/HTML: Executive report con métricas
Cómo testear
pytest tests/unit/test_pipeline.py::TestExports -v
Última actualización: 2026-01-19