ASR language tag parser accepts <unk> as a language

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
backend

調査の方向性

Start with extract_lang_tags in src/asr/runner.cpp and check how prompt_languages() exposes the model's supported codes; also inspect asr.tokenizer.vocab and PR #91's parser move to src/asr/language_tags.cpp. Verify how the parser handles <unk> and real language tags, then identify or add a focused test. Done means <unk> is not reported as a language or removed as a language tag, while valid tags still work.

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

説明

Problem

The language tag parser accepts any <xx> shape, not only real language codes. The <unk> token matches it, so unk can be reported as a detected language.

The pattern on main (src/asr/runner.cpp, extract_lang_tags):

<([A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,4})?)>

<unk> has three letters, so it matches. The Nemotron 3.5 tokenizer vocabulary (asr.tokenizer.vocab) includes <unk>.

Expected effect

I found this by reading the code. I have not seen the decoder emit <unk> in my test audio, so I do not know how often this can happen.

If the decoder emits <unk> with language auto:

  • unk goes into detected_languages, so results list it in language_codes, in CLI languages, and in REST verbose_json language when it comes first.
  • build_result_ uses the first detected language to select the ITN grammar in auto mode, so unk can replace a real language there.
  • The token is removed from the transcript, the same as a real tag.

Possible fix

Accept a tag only when its code is in the model's prompt dictionary (asr.rnnt.prompt_dictionary, available through prompt_languages()), instead of matching by shape. A smaller alternative is to exclude <unk> by name.

Related

PR #91 moves this parser to src/asr/language_tags.cpp and keeps the same pattern. It does not fix this.


AI use: Claude Code found this during work on PR #91

主要言語
C++
スター
207
フォーク
47
平均マージ
13時間 10分
マージ済み PR(30日)
12

環境構築

はじめの一歩

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

NVIDIA/NeMo-Speech.cpp のほかの issue

NVIDIA/NeMo-Speech.cpp の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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