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92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# Lavazza AI Personas - Evaluation Guide

**Version:** 1.0  
**Date:** December 2025  
**Purpose:** Focused evaluation framework for critical system components

---

## 1. Introduction

### 1.1 Purpose

This document provides detailed evaluation methodologies for four critical components of the Lavazza AI Personas system:

1. **Persona Extraction Pipeline** - Validates extraction of persona indicators/metrics from PDF documents
2. **Fact Extraction Accuracy** - Ensures fact data is correctly extracted
3. **Retrieval Relevance** - Measures RAG system's ability to retrieve relevant context
4. **Authenticity Evaluation** - Confirms AI personas authentically represent consumer segments

### 1.2 Evaluation Philosophy

Each evaluation follows a structured approach:

- **Clear objectives** - What we are measuring
- **Step-by-step methodology** - How to conduct the evaluation
- **Example data structures** - Concrete formats for test data

---

## 2. Evaluation Overview

### 2.1 Critical Components Priority

| Component            | Criticality | Impact                          | Evaluation Focus                    |
|----------------------|-------------|---------------------------------|-------------------------------------|
| Persona Extraction   | CRITICAL    | Foundation for all persona data | Accuracy, completeness, consistency |
| Fact Extraction      | CRITICAL    | Factual grounding for responses | Numeric accuracy, attribution       |
| RAG Retrieval        | CRITICAL    | Prevents hallucinations         | Relevance, precision, recall        |
| Persona Authenticity | HIGH        | User trust and value            | Segment alignment, consistency      |


## 3. Persona Extraction Pipeline Evaluation

### 3.1 Objective

Verify that persona indicators (categories,statements, metrics) are correctly extracted from source PDF documents.

### 3.2 Methodology

#### Step 1: Create Ground Truth Dataset

**Action:** Manually annotate 20-30 representative PDF pages (focusing on Curious Connoisseur Segmentation).

**Annotation Process:**

1. Select pages covering:
    - Curious Connoisseur persona segment
    - Various indicator types (demographics, behaviors, preferences, values)
    - Different visual styles (infographics, tables, text blocks)

2. For each page, document:
    - Expected personas mentioned
    - Expected indicators with complete taxonomy (domain/category)
    - Expected statements with associated metrics

3. Store annotations in structured JSON format

**Example Ground Truth Structure:**

```json
{
  "page_id": "page_11",
  "data_source": "data/raw/lavazza_segmentation_report.pdf",
  "page_number": 11,
  "ground_truth": {
    "personas": [
      "curious-connoisseurs"
    ],
    "indicators": [
      {
        "indicator_id": "gt_ind_001",
        "persona_id": "curious-connoisseurs",
        "domain": "demographics",
        "category": "age",
        "label": "age_distribution",
        "statements": [
          {
            "label": "45-54 age group",
            "metrics": [
              {
                "value": 24.0,
                "unit": "%",
                "description": "45-65 age group representation"
              }
            ]
          }
        ]
      }
    ]
  }
}
```

#### Step 2: Run Extraction Pipeline

**Action:** Execute persona extraction on the same annotated pages.

#### Step 3: Compare and Compute Metrics

**Action:** Compare system output against ground truth.

**Metrics to Compute:**

1. **Persona Detection Rate**
   ```
   Persona Detection Rate = (Correctly Detected Personas) / (Total Ground Truth Personas)
   ```

2. **Metric Recall**
   ```
   Metrics Recall = (Correctly Metrics) / (Total Ground Truth Metrics)
   ```

3. **Metric Precision**
   ```
   Metrics Precision = (Correct Metrics) / (All Extracted Metrics)
   ```


**Metric Matching Rules**

Only retain **indicators** and **statements** that contain **at least one metric**.

A metric is considered a match with a ground truth metric **if all of the following conditions are satisfied**:

   1. Indicator Match

   An indicator matches the ground truth if the number of shared words between the indicator label (or description) and the ground truth label, divided by the smaller word count, is at least 70%.
   2. Statement Label Match
   
   A statement label matches the ground truth if the number of shared words between the statement label and the ground truth label, divided by the smaller word count, is at least 70%.
   
   3. Value Match
   
   The metric value must match the ground truth value.
   
   4. Unit Match
   
   Units are considered equivalent if they belong to the same synonym group defined below.
   
   **Unit Synonym Mapping**
   
   | Equivalent Units |
   | ---------------- |
   | %, percentage    |
   | index, idx       |
   | €, euro, eur     |
   | $, dollar, usd   |
   | £, pound, gbp    |
   | ¥, yen, jpy      |
   | ₹, rupee, inr    |
   | ₩, won, krw      |
   | ₽, ruble, rub    |
   | ₺, lira, try     |
   | ₫, dong, vnd     |
   | ₱, peso, php     |
   | ₦, naira, ngn    |
   | ₴, hryvnia, uah  |
   | ₡, colon, crc    |
   | ₲, guarani, pyg  |
   | ₵, cedi, ghc     |
   | ₸, tenge, kzt    |
   | ₼, manat, azn    |

**Implementation Notes**

* Normalize text (lowercase, remove punctuation, collapse whitespace) before computing word intersections.
* Apply the 70% threshold consistently across all matching steps.



## 4. Fact Extraction Accuracy Evaluation

### 4.1 Objective

Ensure data (numbers, percentages, ratios) are correctly extracted from PDF charts, tables, and infographics.

### 4.2 Methodology

#### Step 1: Create Ground Truth from Source Data

**Action:** Obtain or create ground truth with known values.

Manually extract and verify statistics from 20-30 test pages (focus on Curious Connoisseurs).

**Example Ground Truth Data Structure:**

```json
{
  "fact_id": "fact_demographics_001",
  "data_source": "data/raw/lavazza_segmentation_report.pdf",
  "page_number": 11,
  "facts": [
    {
      "value": "52%",
      "context": "female percentage in segment"
    },
    {
      "value": "Ground Coffee: 79, Caps (NCC): 104, Coffee Beans: 206, Caps (NC): 79, Instant Coffee: 49, Paper Pods: 91",
      "context": "Consumption index of curious connoisseurs"
    }
  ]
}
```

#### Step 2: Run Fact Extraction Pipeline

**Action:** Extract facts data using the pipeline to get markdown files for each page.

#### Step 3: Compare and Compute Metrics

**Metrics:**

1. **Exact Match Accuracy**
   ```
   Exact Match Accuracy = (Exactly Matching Values) / (Total Ground Truth Values)
   ```

**Note:** A value is considered a match if more than 80% of the words from the ground truth appear in the markdown file.

## 5. Retrieval Relevance Evaluation

### 5.1 Objective

Measure how well the RAG system retrieves relevant persona and fact context for user queries.

### 5.2 Methodology

#### Step 1: Create Query-Relevance Dataset

**Action:** Generate test queries( focus on Curious Connoisseurs).

**Example Test Queries:**

```json
{
  "test_queries": [
    {
      "query_id": "q_001",
      "persona_id": "curious-connoisseurs",
      "query": "What is your age?"
    },
    {
      "query_id": "q_002",
      "persona_id": "curious-connoisseurs",
      "query": "What is your gender?"
    }
  ]
}
```

#### Step 2: Run Retrieval System

**Action:** Execute RAG retrieval for all test queries.

#### Step 3: Manually Label Relevance

For each query, manually label the relevance of retrieved documents.

**Relevance Labels:**

- **1 :**  Related
- **0 :** Unrelated

**Example Relevance Annotation:**

```json
{
  "query_id": "q_001",
  "persona_id": "curious-connoisseurs",
  "query": "What is your age?",
  "relevant_docs": [
    {
      "page_content": "Average age is 47 years old",
      "relevance": 1
    },
    {
      "page_content": "I like to try out new food or drink products",
      "relevance": 0
    }
  ]
}
```

#### Step 4: Compute Retrieval Metrics

**Metrics:**

1. **Precision@K**
   ```
   Precision@K = (Relevant docs in top-K) / K
   ```

2. **Recall@K**
   ```
   Recall@K = (Relevant docs in top-K) / (Total relevant docs)
   ```
**Implementation notes:**

* Set retrieval **top-k = 20** (configable) to ensure high recall.
* Manually review the retrieved chunks and mark those that are relevant.
* Treat **all marked relevant chunks** as the ground-truth recall set.
* Compute **Precision@k** and **Recall@k** for **k = 3, 5, 10, and 20**.

## 6. Authenticity Evaluation

### 6.1 Objective

Ensure AI personas authentically represent their consumer segments through expert validation and consistency testing.

### 6.2 Methodology

#### Step 1: Generate Persona Responses

**Action:** Create a set of test questions and generate persona responses (focus on Curious Connoisseurs).

**Test Question Categories:**

```json
{
  "test_questions": [
    {
      "persona_id": "curious-connoisseurs",
      "query": "What coffee format do you prefer and why?",
      "category": "product_preferences"
    },
    {
      "persona_id": "curious-connoisseurs",
      "query": "What factors influence your coffee purchasing decision?",
      "category": "product_preferences"
    }
  ]
}
```

#### Step 2: Response Generation

Use the system to generate responses for the persona to all test questions.

#### Step 3: Expert Evaluation

**Action:** Have domain experts rate persona authenticity.

*Rating Criteria:*

1. **Authenticity (1-5 scale)**
    - How well does the response reflect the expected persona characteristics?
    - 1 = Not authentic, 5 = Very authentic
2. **Style Alignment**
    - Tone, vocabulary, reasoning depth
    - 1 = Poorly aligned, 5 = Perfectly aligned
3. **Factual Grounding**
    - Are statements factually accurate and well-cited?
    - 1 = No citations/hallucinations, 5 = Well-cited and accurate

**Expert Evaluation Form:**

```json
{
  "test_questions": [
    {
      "persona_id": "curious-connoisseurs",
      "query": "What coffee format do you prefer and why?",
      "category": "product_preferences",
      "response": "I prefer espresso because...",
      "ratings": {
        "authenticity": 3,
        "style_alignment": 4,
        "factual_grounding": 5
      }
    },
    {
      "persona_id": "curious-connoisseurs",
      "query": "What factors influence your coffee purchasing decision?",
      "category": "product_preferences",
      "response": "Quality is my primary consideration because...",
      "ratings": {
        "authenticity": 4,
        "style_alignment": 4,
        "factual_grounding": 1
      }
    }
  ]
}
```

#### Step 4: Compute Authenticity Metrics

**Metrics:**

1. **Expert Authenticity Score**
   ```
   Average authenticity rating across all expert evaluations (1-5 scale)
   ```

2. **Style Alignment Score**
   ```
   Average style alignment rating across all expert evaluations (1-5 scale)
   ```
3. **Factual Grounding Score**
   ```
    Average factual grounding rating across all expert evaluations (1-5 scale)
   ```