Download src/reference_db/phase_3/grouping/models.py from offCanada/reference-db-system: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/offCanada/reference-db-system/resolve/main/src/reference_db/phase_3/grouping/models.py
- Command line
-
hf download hf://offCanada/reference-db-system/src/reference_db/phase_3/grouping/models.py
-
curl -L -o models.py https://huggingface.co/offCanada/reference-db-system/resolve/main/src/reference_db/phase_3/grouping/models.py
1.19 kB
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| from typing import Any | |
| IDENTITY_COLUMNS = ( | |
| "is_organic", | |
| "is_gluten_free", | |
| "is_naturally_simple", | |
| "is_sugar_free", | |
| "is_unsalted", | |
| "is_lactose_free", | |
| "is_peanut_free", | |
| "is_plant_based", | |
| "is_reduced_sodium", | |
| "fat_percentage", | |
| "fat_level", | |
| "flavour", | |
| "formulation", | |
| ) | |
| class ProductRecord: | |
| external_id: str | |
| product_name: str | |
| core_title: str | |
| identity_attributes: dict[str, Any] | |
| functional_variant: str | None | |
| class CandidatePair: | |
| external_id_a: str | |
| external_id_b: str | |
| product_name_a: str | |
| product_name_b: str | |
| similarity: float | |
| class GroupDecision: | |
| external_id_a: str | |
| external_id_b: str | |
| decision: str | |
| confidence: float | |
| reason: str | |
| class ResolvedGroup: | |
| group_id: str | |
| external_ids: tuple[str, ...] | |
| class ResolutionResult: | |
| groups: tuple[ResolvedGroup, ...] | |
| assignments: dict[str, str] | |
| review_queue: tuple[GroupDecision, ...] | |
| contradictions: tuple[GroupDecision, ...] |