Miseiri見整理
How it works

The matcher, explained.

Miseiri runs each row through a strategy ladder — direct lookup if you have an identifier, fuzzy name match if you don’t — and surfaces ambiguity instead of guessing. Here’s exactly what happens.

The strategy ladder

For each row, Miseiri tries strategies in order and stops at the first that succeeds.

1. Direct NZBN lookup

If your row has a 13-digit NZBN, we fetch the entity record straight from the register. Confidence 1.00. match_method = nzbn_lookup.

2. Companies Office number

If your row has a company number (e.g. 1234567) and no NZBN, we search the register by that number. Single hit ⇒ match. Confidence 1.00.

3. Exact name match

We search the register for the name and check whether any returned candidate matches exactly after normalization (lowercase, strip “Limited”, punctuation, whitespace). Confidence 0.95.

4. High-confidence fuzzy match

The top candidate from the register is scored using a composite of token-set Jaccard, Levenshtein ratio, and token-prefix match. If the score is above the threshold (default 85%) and there’s a clear gap to the runner-up, we accept it. match_method = fuzzy.

5. Needs review

If candidates exist but none clears the bar — score below threshold, or top two too close — we return up to 5 candidates and flag the row needs_review. You pick the right one in the UI.

6. Not found

Only when the register itself returns zero candidates. Often this is a typo too far from the registered spelling — Miseiri retries once with a simplified version (drops “Limited” suffixes, takes the part after “ - ”, drops trailing year) before giving up.

The confidence threshold

The threshold slider on the Choose Fields step controls when Miseiri auto-matches versus when it sends you to review. The default 85% catches typos and word-order differences while staying conservative on near-misses.

When to lower it

Going to 75% catches partial names — “Fontera Cooperative” matching “Fonterra Cooperative Group Limited”. Use only when you plan to eyeball every match.

When to raise it

95%+ accepts only near-identical names. Useful when you’re using Miseiri as a strict identity validator and want anything ambiguous routed to review.

Whatever the threshold, low-confidence candidates always appear in Needs review with the full candidate list — you never lose visibility.

The override dictionary

Sometimes you know a name always means a specific NZBN regardless of what the matcher thinks — your books call them “ABC Co” but they’re really “ABC Holdings (NZ) Limited”. Add an entry to the override dictionary on the Choose Fields step and every future row with that input name resolves directly to the NZBN you specified.

Overrides live in your tab’s session storage — closing the tab clears them. Export to JSON to keep them across sessions. Import to share with colleagues. Saving an override from a confirmed match takes one click.

Deduplication

The same customer often appears multiple times in real ledgers (one billed under several bill-to entities, branches under a parent). Miseiri normalizes each row's name once at upload and caches results in-session — duplicate names are processed once and the result propagates.

You see a tag in the result column showing which rows were resolved from the cache rather than a fresh API call.

The output

Three formats:

Excel — when you uploaded an .xlsx, we append the new columns to your original workbook, preserving formatting, formulas, and other sheets.

CSV — plain CSV with all enriched columns, regardless of input format.

Mihari-ready CSV — a slim two-column file (entity_name, nzbn) of just the matched rows, ready to drop into Mihari’s bulk upload.