-
-
Notifications
You must be signed in to change notification settings - Fork 13
Domain Packs
GoldenMatch includes 7 built-in YAML rulebooks that extract structured fields from unstructured product descriptions and other domain-specific text.
import goldenmatch as gm
rulebooks = gm.discover_rulebooks() # Returns all 7 packs
print(list(rulebooks.keys()))
# ['electronics', 'software', 'healthcare', 'financial', 'real_estate', 'people', 'retail']import goldenmatch as gm
rulebooks = gm.discover_rulebooks()
enhanced_df, low_confidence = gm.extract_with_rulebook(df, "title", rulebooks["electronics"])
# enhanced_df has new columns: __brand__, __model__, __sku__, etc.
# low_confidence contains records where extraction confidence was lowdomain = gm.match_domain(df, "description")
# Returns "electronics", "software", etc., or NoneExtracts brand, model number, SKU, color, and technical specs from product titles.
"Samsung Galaxy S24 Ultra 256GB Titanium Black SM-S928B"
-> brand: Samsung
-> model: Galaxy S24 Ultra
-> sku: SM-S928B
-> color: Titanium Black
-> specs: 256GB
Model normalization strips hyphens, region suffixes, and color suffixes for better matching.
Extracts medical identifiers with contextual prefix requirements (e.g., NPI:, CPT:) to avoid false positives on generic numbers.
"Provider NPI:1234567890, CPT:99213 Office Visit"
-> npi: 1234567890
-> cpt_code: 99213
Create your own YAML rulebook and place it in one of the search paths:
| Path | Scope |
|---|---|
.goldenmatch/domains/ |
Project-local |
~/.goldenmatch/domains/ |
Global (user) |
goldenmatch/domains/ |
Built-in (read-only) |
# .goldenmatch/domains/my_domain.yaml
name: my_domain
description: Custom domain for matching widgets
signals:
- pattern: "widget"
weight: 1.0
- pattern: "part_?number"
weight: 0.8
extractors:
- name: part_number
pattern: "PN[:-]?\\s*(\\w{6,12})"
group: 1
- name: manufacturer
pattern: "(Acme|Globex|Initech)"
group: 1
normalizers:
part_number:
strip_chars: "-"
uppercase: trueimport goldenmatch as gm
gm.save_rulebook("my_domain", rulebook)
loaded = gm.load_rulebook("my_domain")The MCP server provides tools for domain management:
| Tool | Description |
|---|---|
list_domains |
List all available domain packs |
create_domain |
Create a new custom domain pack |
test_domain |
Test a domain pack against sample data |
Domain extraction significantly improves product matching:
| Dataset | Without Domain | With Domain | Improvement |
|---|---|---|---|
| Abt-Buy (electronics) | 44.5% F1 | 72.2% F1 | +27.7pp |
| Amazon-Google (software) | 45.3% F1 | 42.1% F1 | -3.2pp |
Domain extraction helps datasets with structured identifiers (brand, model, SKU) but can hurt datasets with unstructured descriptions. For software matching, clean embedding + ANN pipelines perform better.
⚡ GoldenMatch — Entity resolution toolkit | PyPI | GitHub | Open in Colab | MIT License
🟡 Golden Suite (Monorepo)
Suite Packages
- GoldenCheck · data quality
- GoldenFlow · transforms
- GoldenPipe · orchestrator
- InferMap · schema mapping
Getting Started
- Installation
- Quick Start
- Auto-Config Controller · enhanced through v1.12
- Configuration
- Verification · new in v1.5
- CLI Reference
Core Concepts
AI Integration
Advanced
- PPRL
- Domain Packs
- Streaming / CDC
- Database Integration
- GPU & Vertex AI
- REST API
- Interactive TUI
- Web UI · new in v1.7
- Evaluation
Reference
pip install goldenmatch
npm install goldenmatch