Entity Metrics System
Sistema de cálculo de métricas para entidades detectadas en respuestas de LLM. Mide visibilidad, sentimiento e impacto de negocio.
Métricas Calculadas
Promedio de sentimientos normalizados de todas las menciones. Usa escala 1-5 convertida a -1 a 1. Ratio de menciones positivas vs negativas, excluyendo neutros. Fórmula: (positive - negative) / (positive + negative).
normalized = (sentiment - 3) / 2score = Σ(normalized) / mentionCount
score = (positive - negative) / (positive + negative)// neutral mentions excluded
| Sentimiento | Valor Original | Normalizado |
|---|---|---|
| Muy negativo | 1 | -1.0 |
| Negativo | 2 | -0.5 |
| Neutral | 3 | 0.0 |
| Positivo | 4 | 0.5 |
| Muy positivo | 5 | 1.0 |
| Input | Resultado |
|---|---|
| Solo positivos | 1.0 |
| Solo negativos | -1.0 |
| Solo neutros | 0.0 |
| Mix igual | 0.0 |
Share de importancia posicional usando decay logarítmico. Menciones al inicio tienen más peso.
weight(pos) = 1 / log(pos + 2)score = Σ entityWeights / Σ allWeights
| Posición | Peso |
|---|---|
| 0 (primera) | 1.443 |
| 1 | 0.910 |
| 2 | 0.721 |
| 5 | 0.512 |
| 10 | 0.417 |
Share de menciones de la entidad sobre el total de menciones en la respuesta.
score = entityMentions / totalMentions
Posición promedio donde aparece la entidad. Valores más bajos = mejor posicionamiento.
avgPosition = Σ positions / mentionCount
Score compuesto que combina sentiment, position y mention scores con pesos configurables.
normSentiment = (sentiment + 1) / 2visibility = ( normSentiment × w.sentiment + positionScore × w.position + mentionScore × w.mention) / (w.sentiment + w.position + w.mention)
Score basado en ranking relativo de visibilidad entre todas las entidades de la respuesta.
score = (totalEntities - ranking + 1) / totalEntities
| Ranking | Total | Score |
|---|---|---|
| #1 | 5 | 1.00 |
| #2 | 5 | 0.80 |
| #3 | 5 | 0.60 |
| #5 | 5 | 0.20 |
Score final de impacto de negocio que combina todas las métricas ponderadas. Overall Score: combinación ponderada de todas las métricas, escalado 0-100.
normSentiment = (sentiment + 1) / 2overall = normSentiment × 0.30 + positionScore × 0.25 + mentionScore × 0.25 + competitiveScore × 0.20BIS = round(overall × 100)
Pesos por Defecto
Flujo de Cálculo
Calculadora Interactiva
Comparativa v1 vs v2
| Aspecto | v1 Legacy | v2 Current |
|---|---|---|
| Sentiment Input | positive | negative | neutral |
1-5 (escala numérica) |
| Sentiment Calculation | (pos - neg) / (pos + neg)Excluye neutros |
Σ((s-3)/2) / countIncluye todos |
| Position Index | 1-based (1 = primera) | 0-based (0 = primera) |
| Score Final | overallScore |
businessImpactScore (BIS) |
| Weights Storage | En código (Domain.Weights) | Almacenado con cada métrica |
| Entity Fields | brandId, brandName, brandIdentifier |
entityId, entityName, entityIdentifier, entityType |