Resolver
domain.enrichment.entity.resolver
Summary
Entity resolution nodes for the enrichment pipeline.
Each node advances the entity candidate: alias-based entity assignment, description normalization, candidate extraction, flag-based candidate handling, flag-driven entity setting, and a final fallback.
Classes
CandidateBasedFlagsNode
Bases: RegistryNode
Attach candidate-keyword flags derived from the candidate value.
For each flag in the configured mapping, when any keyword appears in
the (lower-cased) candidate value and the flag is not already
present, the flag is appended to candidate.flags.
Attributes
candidate_based_flag_mapping
property
Return the candidate-keyword flag mapping.
Returns:
| Type | Description |
|---|---|
|
The mapping dict from the registry. |
config
property
Return the node config installed by the pipeline loader.
Returns:
| Type | Description |
|---|---|
|
The node configuration dict, or |
Functions
resolve
Append matched candidate-keyword flags to the state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Pipeline state with a candidate value and flags. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
The updated state, or the input state when no flag |
Iterable[State]
|
changed. |
set_config
Install the node-specific config on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
The config dict read from the pipeline YAML for this node's id. |
required |
set_registry
Install the pattern registry on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
The |
required |
EntityAliasNode
Bases: RegistryNode
Resolve an entity directly from alias regexes.
When entity.name is already set, or no candidate value exists,
the state passes through unchanged. Otherwise the first alias regex
that matches the candidate produces the entity payload with a
confidence delta of -0.25 and the resolved_by=entity_alias
metadata marker.
Notes
A fork is yielded immediately on the first matching alias; no further aliases are considered.
Attributes
config
property
Return the node config installed by the pipeline loader.
Returns:
| Type | Description |
|---|---|
|
The node configuration dict, or |
default_logo_mapping
property
Return the default logo mapping by entity type.
Returns:
| Type | Description |
|---|---|
|
The mapping dict from the registry, defaulting to |
|
|
|
entity_alias_regex
property
Return the compiled alias regex/value pairs.
Returns:
| Type | Description |
|---|---|
|
The compiled regex-map entries from the registry. |
entity_type_mapping
property
Return the entity-type mapping for assigned entities.
Returns:
| Type | Description |
|---|---|
|
The mapping dict from the registry, defaulting to |
|
|
|
Functions
resolve
Assign the entity from the first alias matching the candidate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Pipeline state with |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
The forked state with the entity payload, or the input |
Iterable[State]
|
state when nothing matched. |
set_config
Install the node-specific config on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
The config dict read from the pipeline YAML for this node's id. |
required |
set_registry
Install the pattern registry on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
The |
required |
ExtractCandidatesNode
Bases: RegistryNode
Extract entity candidates from the normalized signals.
Produces a candidate per regex match and per /-split part; when
nothing matched, falls back to canonicalized space-split items and
finally to an empty (-0.75) fork. Negative candidates are
skipped throughout.
Attributes
candidate_regex
property
Return the compiled candidate extraction regexes.
Returns:
| Type | Description |
|---|---|
|
The compiled regex list from the registry. |
config
property
Return the node config installed by the pipeline loader.
Returns:
| Type | Description |
|---|---|
|
The node configuration dict, or |
negative_candidates
property
Return the negative candidate tokens to skip.
Returns:
| Type | Description |
|---|---|
|
The array of negative candidate strings from the registry. |
Functions
resolve
Yield one state fork per extracted candidate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Pipeline state with populated |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
A forked state per candidate, each carrying |
Iterable[State]
|
|
|
Iterable[State]
|
candidate was found. |
set_config
Install the node-specific config on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
The config dict read from the pipeline YAML for this node's id. |
required |
set_registry
Install the pattern registry on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
The |
required |
FallbackNode
Bases: RegistryNode
Assign a last-resort entity when nothing resolved.
Valid candidates become the merchant (-0.25); otherwise the
entity falls back to Unknown with type other (-0.50),
using the default logo paths.
Attributes
config
property
Return the node config installed by the pipeline loader.
Returns:
| Type | Description |
|---|---|
|
The node configuration dict, or |
Functions
resolve
Fork the state with a fallback entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Pipeline state with an optional candidate value. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
The forked state with the fallback entity payload. |
set_config
Install the node-specific config on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
The config dict read from the pipeline YAML for this node's id. |
required |
set_registry
Install the pattern registry on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
The |
required |
NormalizeDescriptionNode
Bases: RegistryNode
Normalize the raw description into signal fields.
Removes the amount/balance number sequences from the description and
populates signals.raw, signals.items (space-split) and
signals.parts (slash-split) for downstream nodes.
Attributes
config
property
Return the node config installed by the pipeline loader.
Returns:
| Type | Description |
|---|---|
|
The node configuration dict, or |
Functions
resolve
Fork the state with the normalized description signals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Pipeline state with |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
The forked state carrying the derived signals. |
set_config
Install the node-specific config on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
The config dict read from the pipeline YAML for this node's id. |
required |
set_registry
Install the pattern registry on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
The |
required |
SetEntityNode
Bases: RegistryNode
Set the entity from flag-based entity rules.
Each rule config may carry all/any conditions over the
candidate flags; the first satisfied rule emits its payee as the
entity with a resolved_by=set_entity marker. When no rule fires
and no entity exists yet, a -0.25 fork is yielded.
Attributes
config
property
Return the node config installed by the pipeline loader.
Returns:
| Type | Description |
|---|---|
|
The node configuration dict, or |
default_logo_mapping
property
Return the default logo mapping by entity type.
Returns:
| Type | Description |
|---|---|
|
The mapping dict from the registry, defaulting to |
|
|
|
entity_type_mapping
property
Return the entity-type mapping for assigned entities.
Returns:
| Type | Description |
|---|---|
|
The mapping dict from the registry, defaulting to |
|
|
|
flags_based_entity_rules
property
Return the flag-based entity rules.
Returns:
| Type | Description |
|---|---|
|
The rule list from the registry. |
Functions
resolve
Apply flag-based entity rules and fork the entity state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Pipeline state with candidate flags. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
The forked state with the entity payload when a rule |
Iterable[State]
|
fires; the input state when an entity already exists; or a |
|
Iterable[State]
|
|
set_config
Install the node-specific config on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
The config dict read from the pipeline YAML for this node's id. |
required |
set_registry
Install the pattern registry on this node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
The |
required |