Skip to main content
The Fuzzy Matcher (fuzzy_matcher) takes two inputs — an uncertain string (typically STT output) and a source of truth (a single string or an array of strings) — and returns the source-of-truth entry that best matches the uncertain input. It uses RapidFuzz composite scoring so imperfect transcriptions still map to the right label. This mirrors the two-input shape of the Conditional node, but instead of an exact comparison it returns a similarity score plus the matched string.
Palette category: Transform & Routing. Runs on cloud workflows and edge workers (same matching logic in both paths).

Typical chain

Wire query (uncertain string) from Call Model result. Wire candidates (source of truth) from Twin node control_actuations — either an array, or a single string from any upstream node. Branch on match and pass match_string into actuation.

Inputs

Inspector (node parameters):
  • Score Threshold — minimum similarity (0–100) to count as a match. Higher = stricter. Default 80.
  • Uncertain String (optional) — static fallback when query is not wired from upstream.
  • Source of Truth (optional) — one option per line, or a single string. Used when candidates is not wired from upstream.
Precedence: wired input mapping → node parameter → default (80 for threshold).

Outputs

Deprecated aliases (kept for older workflows): Advanced echo (debugging): query, candidates, score_threshold.

How matching works

  1. Normalize query and each candidate: lowercase, collapse whitespace, treat _ and - as spaces, strip punctuation (move_forwardmove forward).
  2. Score each candidate with the max of:
    • token_set_ratio — extra words, shuffled order
    • token_sort_ratio — similar order with typos
    • partial_ratio (both directions) — label inside a long phrase, or short utterance inside a label
    • WRatio — general typo tolerance
  3. Pick the highest-scoring source-of-truth entry as match_string.
  4. Set match to true only if that score ≥ score_threshold.
RapidFuzz scores are always on a 0–100 scale (100 = perfect after normalization).

Examples (threshold 80)

Tuning score_threshold

Use the score output to calibrate: if good phrases often score 75–79, lower the threshold slightly; if unrelated text still passes, raise it.

Execution targets

Dependencies

Error if compile server lacks the package:
This workflow uses Fuzzy Matcher but rapidfuzz is not installed on the compile server. Install rapidfuzz (or cyberwave[fuzzy-match]) on Django before compiling for edge.
See Edge workflow dependencies.