Custom vocabulary on non-Latin speech: English-only CTC verifier scores Cyrillic words as <unk>, so Latin terms replace ordinary words; CLI also ignores JSON thresholds

オープン
#1,193 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
json, machine-learning, swift

調査の方向性

Start with BpeTokenizer.swift:177, VocabularyRescorer+TokenEvaluation.swift:170, and TranscribeCommand.swift:876, then compare them with VocabularyBoostingSession.swift:169 and loadWithCtcTokens. Run the transcription CLI with a Cyrillic custom vocabulary to reproduce the ignored thresholds and false Latin replacements. Done means JSON thresholds are honored consistently, the handling of <unk> and caller-provided ctcTokenIds is defined, and the selected behavior is covered by tests or a reproducible CLI report.

索引モデルが issue の本文から書いたものです。

説明

Setup. fluidaudiocli transcribe --local-model-dir <Parakeet TDT 0.6B v3 fine-tune> --custom-vocab vocab.json, main e2ea498. Speech is Russian/Ukrainian with English product names (MyRemotely, Rentvine, 1oT, lockbox). The vocab JSON uses FluidVoice's format (alpha, minCtcScore, minSimilarity, minCombinedConfidence, weight, Cyrillic and Latin aliases).

Results on 86 real Russian voice messages.

Good: My Remotely → MyRemotely, Rentwine → Rentvine, One Aut / вана уйти → 1oT.

False replacements:

  • онлайн / ассайн → Rentvine (alias андвайн, similarity 0.57)
  • так как / но, как / логику → lockbox
  • прямо на / времени → Remo
  • мы могли / мы можем → MyRemotely
  • allow → Zillow, сим → eSIM, work order → work owner
  • Neighbour words get swallowed: в логбаксе → локбакс

Changing weight (10 → 4) and the JSON minSimilarity (0.72 → 0.8) / minCombinedConfidence (0.64 → 0.75) changed nothing in the output.

Root causes found in the source.

  1. The verifier is parakeet-ctc-110m (English, 1024 BPE pieces, no Cyrillic and no byte pieces). Cyrillic originals encode to <unk> pieces (BpeTokenizer.swift:177), so the original span's CTC score is degenerate and boosted(term) > original (VocabularyRescorer+TokenEvaluation.swift:170) passes for almost any Latin term, even with --vocab-cbw 0. #967 noted the spotter is English-only; this is the other half: non-Latin originals.
  2. The batch CLI ignores vocabulary-level thresholds. It passes args.vocabMinSimilarity ?? rescorerConfig(forVocabSize:).minSimilarity (TranscribeCommand.swift:876), so the JSON minSimilarity has no effect, while VocabularyBoostingSession uses it as a floor (VocabularyBoostingSession.swift:169). App and CLI therefore behave differently. alpha, minCtcScore and minCombinedConfidence are decoded but not read by the Parakeet rescorer, and weight is unused on this path.
  3. A JSON ctcTokenIds value is overwritten in loadWithCtcTokens, so a caller cannot supply its own spoken form.

Suggested options (any subset helps):

  1. Honour the JSON thresholds in the CLI batch path, the same way as the session (max(override ?? sizeDefault, vocab.minSimilarity)). Wire or remove minCtcScore / minCombinedConfidence / alpha, and document that weight is unused.
  2. Script / <unk> guard: skip the CTC comparison, or reject the candidate, when the original span tokenizes mostly to <unk>. Optionally do not let a Latin term replace a non-Latin span unless an alias matches exactly. Allow per-language stopword lists.
  3. A per-term pronunciation / spoken field (a Latin spelling as spoken, or caller-kept ctcTokenIds) used for CTC scoring, separate from the output text. Longer term: a multilingual CTC verifier.
  4. Per-term neverReplace words, plus a CLI --vocab-report <json> that prints ctcTokenEvaluateCandidates (term, alias, similarity, raw scores, boost, spotter-rescue origin) for debugging.

Related: #967, #1151, #702, #724, #647.

主要言語
Swift
スター
3k
フォーク
451
平均マージ
1日 19時間
マージ済み PR(30日)
87

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FluidInference/FluidAudio のほかの issue

FluidInference/FluidAudio の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。