Groupe de veille en analyse textuelle
2026-06-30
Context
COICOP : Classification of Individual Consumption by Purpose
| Level | Example |
|---|---|
| 1 - Division | 01 - Food |
| 4 - Sub-class | 01.1.1.1 - Rice |
Household Budget Survey (HBS) : new wave in 2026
Goal: understand households expenditure (consumption basket)
~70,000 distinct free-text labels to code into COICOP
New collection modes: smartphone, receipts, paper
COICOP updated since 2017 → limited reuse of past labels
Annotation team: 7 people → 1
Deadline: 6 months to build a production-ready pipeline
Context
Classification
Labels
Annotation
Tools
The Coding Methods
The Coding Methods
Principle
Example - Query: "baguette" (bread)
| Suggester candidate | Code | LCSubstr distance |
|---|---|---|
| baguette | 01.1.1.1 |
0.0 |
| baguette en bois | 05.5.2 |
0.5 |
→ Best match (lowest distance): 01.1.1.1
Output: top-1 candidate code + LCSubstr distance
The Coding Methods
torchText Classifiers : Architecture
Training data
Output: top-k predictions + confidence scores + word attributions
The Coding Methods
Principle
Model choices (deployed on vLLM)
Output: predicted COICOP code (JSON) + LLM self-confidence score
The Coding Methods
| LCSubstr | TTC | RAG | |
|---|---|---|---|
| Annotation burden | Low | High | None |
| Process | No LLM, no GPU | GPU training / no LLM at inference | LLM + vector DB at inference |
| Speed | Fast (parallelised C) | Slow training / Fast at inference | Slower (LLM generation) |
| Quality signal | LCSubstr distance (0–1) | Calibrated confidence score | LLM self-reported confidence |
| Explainability | Common substring | Word attributions | LLM self-reporting |
| Accuracy L1 | 67.5% | 87.6% | 82.7% |
| Accuracy L4 | 47.1% | 81.1% | 65.5% |
LLM-as-Judge
The arbitration step
Why LLM rather than majority vote?
A vote counts voices but the LLM weights quality signals (confidence, distance) and uses the full purchase context to resolve what no method could distinguish alone.
Two cost-saving shortcuts
Results
| Pipeline coding stage | Coverage |
|---|---|
| Step 1 - Regex | |
| Regex pattern | 8% |
| Manual review flagged | 1% |
| Step 2 - Three methods | |
| Consensus shortcut (no LLM call) | 7% |
| Step 3 - LLM-as-Judge | |
| LLM-as-Judge arbitration | 84% |
| ↳ of which: flagged for expert review | 3.5% |
Accuracy (~7,350 annotated labels)
Accuracy likely underestimated: ~10% known error rate in manual annotations (domain expert estimate).
Results
Division-level (L1) accuracy over the ~7,350 annotated test labels. Overall the pipeline lands in the correct COICOP division 90.0% of the time, but accuracy and coverage vary widely between divisions.
| Division (level 1) | n | Acc. L1 |
|---|---|---|
| 01 Food & non-alcoholic beverages | 3,591 | 97.9% |
| 02 Alcoholic bev., tobacco, narcotics | 130 | 94.6% |
| 03 Clothing & footwear | 241 | 87.1% |
| 04 Housing, utilities & fuels | 219 | 72.1% |
| 05 Furnishings & household equipment | 372 | 86.6% |
| 06 Health | 203 | 88.2% |
| 07 Transport | 422 | 94.1% |
| 08 Information & communication | 127 | 94.5% |
| Division (level 1) | n | Acc. L1 |
|---|---|---|
| 09 Recreation, sport & culture | 669 | 89.1% |
| 10 Education | 23 | 69.6% |
| 11 Restaurants & accommodation | 492 | 78.9% |
| 12 Insurance & financial services | 124 | 89.5% |
| 13 Personal care & misc. services | 301 | 90.7% |
| 98 Ambiguous / non-codable labels* | 229 | 23.6% |
| 99 Non-consumption expenditure* | 207 | 75.4% |
| Overall | 7,350 | 90.0% |
MLOps
SSPCloud : INSEE’s open data science platform, built on Onyxia, running on Kubernetes. This platform is not a production one, used for experimentation but the pipeline is designed to be production-ready.
Argo Workflows sequences the 9 pipeline steps, running the three methods in parallel, then feeding results into the LLM-as-Judge
Each step reads/writes Parquet files on S3
LLMs are served via vLLM and exposed through an internal LLM platform providing an OpenAI-compatible API, connected to SSPCloud.
| Component | Role |
|---|---|
| Argo Workflows | jobs orchestration |
| vLLM | LLM inference & embeddings |
| Qdrant | Vector database |
| Langfuse | Prompt versioning |
| MLflow | Experiment tracking |
Conclusion
Current limits
Improvements
Conclusion
A hybrid, production-ready pipeline
The key message