Skip to content

Feature request: decode-time vocabulary biasing via FluidAudio custom vocabulary (proper nouns + inflected languages) #21

Description

@krzysztofgos-pixel

First: thank you for shipping both #17 and #18 within a day. Presspeech is my daily driver for all dictation (Polish), and this request comes from heavy real-world use.

The problem

The Dictionary & Shortcuts feature works after transcription: the model still mishears, and a rule patches the string. For proper nouns this means one rule per surface form. I currently maintain 197 correction rules, and a large share are just inflection variants of the same names (Polish is heavily inflected — a surname like „Szypański" also appears as „Szypańskiego", „Szypańskiemu", „Szypańskim"…). This affects every inflected language (Polish, Czech, Finnish, German, …), not just mine.

The engine already solves this

Presspeech depends on FluidAudio (Package.swift pins FluidInference/FluidAudio), and FluidAudio ships a complete custom-vocabulary module that Presspeech currently does not call (grep for vocabular|boost|biasing in the Swift sources: no hits):

public struct CustomVocabularyTerm {
    public let text: String          // term to boost
    public let weight: Float?        // strength
    public let aliases: [String]?    // alternative spellings
    public let tokenIds: [Int]?      // decode-time biasing on TDT tokens
    public let ctcTokenIds: [Int]?   // auxiliary CTC keyword spotter
    public let minSimilarity: Float? // similarity threshold
}

FluidAudio's CLI already exposes --custom-vocab, --vocab-min-similarity, --vocab-cbw, --vocab-margin. Another app on the same engine (FluidVoice) exposes CTC vocabulary boosting to users via a plain dictionary list, so the integration path is proven in practice.

The proposal

An opt-in, fully on-device vocabulary list (plain text, one term per line, optional weight) that is passed to FluidAudio's CustomVocabularyContext at decode time. Because biasing works on tokens rather than exact strings, one entry covers all inflected forms — something no amount of post-hoc rules can do. A minimal first step could even reuse the existing Dictionary & Shortcuts entries as the bias source.

This stays squarely inside Presspeech's philosophy: local, deterministic, opt-in, no cloud, no AI rewriting.

What I can offer

Happy to test any build against real Polish dictation. I have a frozen 25-sentence benchmark harness (229 words, WER + critical-error scoring, fixed ground truth) that I used to compare Presspeech against FluidVoice, so I can give you before/after numbers, not just impressions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions