Skip to main content

Module feature_encoder

Module feature_encoder 

Source
Expand description

Encode extraction results into 128-float feature vectors.

§Missing data strategy

  • 0.0 means “absent/unknown” for all optional features.
  • NodeFlags bits distinguish “value is genuinely zero” from “unknown”:
    • features[48] = 0.0 + HAS_PRICE → price is genuinely $0 (free)
    • features[48] = 0.0 + no HAS_PRICE → price not found on page
  • Non-USD currency: stored raw in original currency. No conversion.
  • Price ranges (“$200–$350”): low end stored in features[48].
  • Text ratings (“Excellent”): mapped to numeric 0.0–1.0.

Structs§

FeatureEncodeResult
Result of feature encoding, including computed flags.

Functions§

encode_features
Encode extraction results + navigation info into a 128-float feature vector.
encode_features_from_patterns
Encode features from pattern-based extraction (Layer 1.5) without browser rendering.
encode_features_from_structured_data
Encode features from structured data (Layer 1) without browser rendering.
encode_features_with_flags
Encode extraction results and also return computed NodeFlags.
merge_features
Merge features from multiple sources, picking the highest-confidence value per dimension.