File size: 4,455 Bytes
7f5738d
 
 
 
 
 
 
 
 
 
 
397c5a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---

license: mit
language:
- en
pretty_name: Open Food Facts Canada Final Deliverables
tags:
- data-quality
- deduplication
- open-food-facts
---


# Open Food Facts (Canada) — Final Deliverables

Welcome to the **offCanada Final Deliverables** repository. This repository contains the complete dataset processing pipelines, deduplication models, data quality migration frameworks, and regulatory rule-packs developed for the Open Food Facts Canada initiative.

---

## 📁 Repository Overview

This repository is structured into two main independent deliverable folders:

```text

offCanada/Final_Deliverables/

├── OpenDB_Compliments_Merged/   # Deduplication & Product Grouping Pipeline

├── OFF_DataQuality/              # Perl-to-Python Data Quality & Multi-Engine Framework

└── README.md                     # Top-level navigation guide (this file)

```

---

## 🚀 Quick Navigation Guide

### 1. `OpenDB_Compliments_Merged/`
> **Purpose**: Deduplication & Canonical Product Mapping for Open Food Facts and Compliments brand product datasets.

- **What it does**: Groups duplicate product records, generates canonical product representations, and maps raw product listings to canonical clusters using LLM-assisted and candidate generation techniques.
- **Key Files to Look At**:
  - [`README.md`](./OpenDB_Compliments_Merged/README.md) — Detailed pipeline documentation and workflow instructions.
  - [`Deduplication_Pipeline_Documentation.docx`](./OpenDB_Compliments_Merged/Deduplication_Pipeline_Documentation.docx) — Full methodology report and architecture details.
  - [`canonical_products.parquet`](./OpenDB_Compliments_Merged/canonical_products.parquet) — Resulting dataset of canonical/deduplicated products.
  - [`product_mapping.parquet`](./OpenDB_Compliments_Merged/product_mapping.parquet) — Mapping table linking raw product IDs to canonical cluster IDs.
  - [`deduplicated_comparison.csv`](./OpenDB_Compliments_Merged/deduplicated_comparison.csv) — Comparative analysis of original vs. deduplicated product entries.
  - [`candidate_gen.py`](./OpenDB_Compliments_Merged/candidate_gen.py) & [`llm_grouper.py`](./OpenDB_Compliments_Merged/llm_grouper.py) — Core Python scripts for candidate cluster generation and LLM product grouping.

---

### 2. `OFF_DataQuality/`

> **Purpose**: Legacy Perl-to-Python Data Quality Migration, Multi-Engine Benchmarking (`dbt` / `Soda`), and Canadian Food Regulatory Rule-Packs.



- **What it does**: Modernizes legacy Open Food Facts Perl data quality checks (`.pl`) into Python validation routines, dbt-core SQL tests, and SodaCL YAML contracts. Features statistical confidence scoring, automated semantic guardrails, and an interactive Streamlit comparison dashboard.

- **Key Files to Look At**:

  - [`README.md`](./OFF_DataQuality/README.md) — Comprehensive technical documentation, architecture diagram, and execution guide.

  - [`dashboard/app.py`](./OFF_DataQuality/dashboard/app.py) — Streamlit interactive dashboard for side-by-side engine comparison and rule metrics.

  - [`validation/engine_comparison.py`](./OFF_DataQuality/validation/engine_comparison.py) & [`validation/parity_validator.py`](./OFF_DataQuality/validation/parity_validator.py) — Multi-engine parity benchmarking and statistical confidence evaluation engines.

  - [`rulepacks/registry.py`](./OFF_DataQuality/rulepacks/registry.py) — Rule profile registry (Global rules, Canada-specific food regulatory rules with legal citations, and Hybrid mode).

  - [`perl_checks/rules/`](./OFF_DataQuality/perl_checks/rules/) — 19 legacy Perl data quality rule scripts (`.pl`).

  - [`results/engine_comparison.json`](./OFF_DataQuality/results/engine_comparison.json) — Pre-computed multi-engine benchmark comparison report.



---



## 📌 Summary Table



| Folder | Core Focus | Key Output / Entry Point |

| :--- | :--- | :--- |

| **[`OpenDB_Compliments_Merged`](./OpenDB_Compliments_Merged)** | Product Deduplication & Canonical Mapping | `canonical_products.parquet` & `Deduplication_Pipeline_Documentation.docx` |
| **[`OFF_DataQuality`](./OFF_DataQuality)** | Data Quality Migration & Benchmarking | `dashboard/app.py` & `validation/engine_comparison.py` |

For detailed setup, execution commands, and implementation details for each component, please navigate into the respective folder and refer to its internal `README.md`.