compute_det_ctc make_pair drops transcript words that equal the utterance id

Offen
#3,978 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@nurlanmnn arbeitet bereits daran.

Seit 29.11.2026.

  • #3979 von @nurlanmnn — offen

Bewertung

Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python, pytorch
Bereich
backend, testing-qa

Rechercherichtung

Read funasr/utils/compute_det_ctc.py and inspect make_pair(), which the issue identifies as the source of the transcript truncation. The issue provides two reproductions and the expected text; verify that words matching the utterance ID are retained while parsing the transcript after its first field. The author says a small PR with a test is ready, so check for work already underway before starting.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

make_pair() in funasr/utils/compute_det_ctc.py (used by the fsmn_kws finetune recipe to score keyword spotting) gets the transcript with line.replace(arr[0], '').strip(). That removes every occurrence of the utterance id in the line, not just the id at the start. So if the id also appears inside the transcript, those words are dropped, and the text that decides keyword vs. filler is wrong.

Repro:

from funasr.utils.compute_det_ctc import make_pair

print(make_pair(["1 /a.wav"], ["1 turn on light 1"])[0]["txt"])
print(make_pair(["go /a.wav"], ["go go go forward"])[0]["txt"])

Actual: turn on light and forward
Expected: turn on light 1 and go go forward

Fix: take everything after the first field, e.g. line.strip().split(maxsplit=1)[1].strip(). I have a small PR with a test ready.

Vorherrschende Sprache
Python
Sterne
21.2k
Forks
2.2k
Ø Merge
5 Std. 38 Min.
Gemergte PRs (30 T.)
116

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus modelscope/FunASR

Alle Issues in modelscope/FunASR

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.