|
Download OpenDB_Compliments_Merged/README.md from offCanada/Final_Deliverables: direct link, hf CLI and curl.
- Browser
- Download file 4.41 kB
-
https://huggingface.co/datasets/offCanada/Final_Deliverables/resolve/03f91aa10ee99336408242c0e328092a497a267f/OpenDB_Compliments_Merged/README.md
- Command line
-
hf download hf://datasets/offCanada/Final_Deliverables@03f91aa10ee99336408242c0e328092a497a267f/OpenDB_Compliments_Merged/README.md
-
curl -L -o README.md https://huggingface.co/datasets/offCanada/Final_Deliverables/resolve/03f91aa10ee99336408242c0e328092a497a267f/OpenDB_Compliments_Merged/README.md
4.41 kB
| language: | |
| - en | |
| - fr | |
| license: mit | |
| task_categories: | |
| - text-classification | |
| - tabular-classification | |
| tags: | |
| - grocery | |
| - deduplication | |
| - retail | |
| - food | |
| pretty_name: Bilingual Grocery Product Deduplication | |
| # Bilingual Grocery Product Deduplication Dataset | |
| ## Dataset Summary | |
| This dataset contains a fully deduplicated, canonical list of bilingual (English and French) grocery products. The original raw data consisted of noisy grocery inventory records with varying formats, typos, languages, and branding. | |
| This repository provides the final cleaned dataset, the mapping of raw barcodes to canonical IDs, and a side-by-side comparison file to review the deduplication results. The deduplication was performed using a high-precision "Name-First" architecture combining token-overlap heuristics, multilingual embeddings, and Large Language Model (LLM) reasoning. | |
| ## File Structure | |
| | File | Description | | |
| |---|---| | |
| | `canonical_products.parquet` | The clean, deduplicated database of the 1,109 unique canonical products, complete with averaged nutritional data. | | |
| | `product_mapping.parquet` | The lookup table mapping every original 13-digit barcode (`code`) to its new `canonical_product_id`. | | |
| | `deduplicated_comparison.csv` | A flat, human-readable CSV that joins the original data side-by-side with the new canonical groupings. Excellent for human review of the "before and after" state. | | |
| | `Deduplication_Pipeline_Documentation.docx` | Comprehensive documentation outlining the v3 pipeline architecture, the modifier vetoes, the LLM usage, and final metrics. | | |
| | `preprocess.py` | Phase 1 of the pipeline: Strict text normalization, cleaning, and exact-matching. Drops unnamed rows. | | |
| | `candidate_gen.py` | Phase 2 of the pipeline: Generates fuzzy-match candidate pairs using a 0.65 Jaccard overlap threshold, bilingual embeddings, and applies hardcoded Modifier/Ingredient Vetoes. | | |
| | `llm_grouper.py` | Phase 3 of the pipeline: Feeds the surviving ambiguous clusters to the LLM for atomic, semantic grouping to prevent chain-merging. | | |
| | `llm_utils.py` | A custom LLM load balancer that routes requests between Groq, OpenRouter, NVIDIA, and Ollama, handling rate limits and JSON parsing. | | |
| | `generate_outputs.py` | Phase 4 of the pipeline: Reads the final canonical JSON and builds the resulting Parquet and CSV dataset files. | | |
| ## Methodology (The v3 "Name-First" Architecture) | |
| The dataset was constructed using a highly defensive deduplication pipeline designed to prioritize precision over recall (i.e., strictly avoiding the merging of different flavours, heat levels, or base ingredients). | |
| 1. **Phase 1: Strict Normalization & Exact Match** | |
| - Stripped brand prefixes (e.g., "Compliments", "Sensations"). | |
| - Fixed French encoding artifacts and normalized casing/plurals. | |
| - Grouped all exact textual matches automatically. Unnamed barcode rows were intentionally dropped from the deduplication pool to prevent nutrition-based pollution. | |
| 2. **Phase 2: High-Confidence Candidate Generation & Vetoes** | |
| - Pairs were generated using a strict **Jaccard Token Overlap** threshold (≥ 0.65). | |
| - Multilingual embeddings (`paraphrase-multilingual-MiniLM-L12-v2`) were selectively applied *only* to cross-language (English ↔ French) pairs. | |
| - **Modifier Veto:** Before any candidate was approved, it passed through a rigorous check against hardcoded lists of flavours, heat levels, fat percentages, and core ingredient nouns. E.g., If a candidate pair consisted of *Cherry Jelly Powder* and *Lime Jelly Powder*, the flavour mismatch triggered an auto-veto. | |
| 3. **Phase 3: Group-Based LLM Judging** | |
| - Surviving ambiguous candidates were clustered into connected components. | |
| - These small clusters were passed to an LLM (Llama 3.3 70B / Llama 3.1 8B). The LLM evaluated entire groups atomically to explicitly prevent transitive chain-merging (where A=B and B=C incorrectly causes A=C). | |
| ## Results | |
| - **Original Dataset:** 2,078 rows (1,322 named products, 756 unnamed) | |
| - **Final Canonical Products:** 1,109 | |
| - **Safe Deduplication Rate:** 46.6% (on named products) | |
| The pipeline successfully resolved complex typos (e.g., *Two Bite Brownines* -> *TWO-BITE Brownies*) and bilingual equivalents (e.g., *Fromage Cottage* -> *Cottage Cheese*), while successfully isolating specific product varieties (e.g., separating *Lemon Lime Sparkling Water* from *Orange Sparkling Water*). | |