| Property | Value |
|---|---|
| Source | phase1/outputs/phase1_output.parquet |
| Row Count | 4,440 |
| Column Count | 20 |
brand_clean from Phase 1 (already whitespace/case normalized)brand_norm (Compliments/Sensations) + product_line (Core/Organic/Balance/Naturally Simple/Green/Little Ones/Sensations)title_clean from Phase 1)title, upc, external_id, or other source identifiersphase2_output.parquet) contains 38 columns:| # | Column | Type |
|---|---|---|
| 1 | upc | str |
| 2 | external_id | str |
| 3 | brand | str |
| 4 | title | str |
| 5 | price | float64 |
| 6 | price_currency | str |
| 7 | size | str |
| 8 | size_amount | float64 |
| 9 | size_unit | str |
| 10 | size_qty | int64 |
| 11 | size_unit_norm | str |
| 12 | image_url | str |
| 13 | source | str |
| 14 | source_url | str |
| # | Column | Type | Description |
|---|---|---|---|
| 15 | brand_clean | str | Cleaned brand (from Phase 1) |
| 16 | brand_raw | str | Original brand (from Phase 1) |
| 17 | title_clean | str | Cleaned title (from Phase 1) |
| 18 | title_raw | str | Original title (from Phase 1) |
| 19 | upc_raw | str | Original UPC (from Phase 1) |
| 20 | external_id_raw | str | Original external_id (from Phase 1) |
| # | Column | Type | Description |
|---|---|---|---|
| 21 | brand_norm | str | Normalized brand (Compliments/Sensations) |
| 22 | product_line | str | Product line (Core/Organic/Balance/Naturally Simple/Green/Little Ones/Sensations) |
| 23 | is_organic | bool | Organic flag |
| 24 | is_gluten_free | bool | Gluten-free flag |
| 25 | is_naturally_simple | bool | Naturally Simple flag |
| 26 | is_sugar_free | bool | Sugar-free flag |
| 27 | is_unsalted | bool | Unsalted flag |
| 28 | is_lactose_free | bool | Lactose-free flag |
| 29 | is_peanut_free | bool | Peanut-free flag |
| 30 | is_plant_based | bool | Plant-based flag |
| 31 | is_reduced_sodium | bool | Reduced sodium flag |
| 32 | fat_level | str | Fat level (fat_free/reduced_fat/regular) |
| 33 | fat_percentage | float64 | Fat percentage from title (nullable) |
| 34 | flavour | list | Extracted flavour keywords |
| 35 | formulation | list | Extracted formulation keywords |
| 36 | variant_attributes | str | Parsed size as JSON |
| 37 | core_title | str | Title with brand prefix + size stripped |
| 38 | identity_hash | str | Deterministic 14-field identity hash |
| Check | Result |
|---|---|
| Row count preserved (4,440) | PASS |
| All original columns preserved | PASS |
| All 18 new columns added | PASS |
| Brand normalization (2 values) | PASS |
| Product line (7 values) | PASS |
| Fat level values valid | PASS |
| Identity flags are boolean | PASS |
| Core titles not empty | PASS |
| Identity hashes not empty | PASS |
| No duplicate external_ids | PASS |
| Overall | PASS |
phase2/
README.md
src/phase2.py
notebooks/phase2.ipynb
outputs/
phase2_output.parquet
phase2_executed.ipynb
validation/
phase2_validation.json
statistics/
phase2_statistics.json1# Using the Python script
2cd /home/sara/gsoc/compliments-reference-db
3python -m phase2.src.phase2
4
5# Using the notebook
6jupyter notebook phase2/notebooks/phase2.ipynbphase2/outputs/phase2_output.parquet