compute_det_ctc make_pair drops transcript words that equal the utterance id

Ouverte
#3,978 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@nurlanmnn y travaille déjà.

Depuis le 29/11/2026.

  • #3979 par @nurlanmnn — ouverte

Évaluation

Difficulté
1/5
Temps estimé
Moins d'une heure
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python, pytorch
Domaine
backend, testing-qa

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Python
Étoiles
21.2k
Forks
2.2k
Merge moyen
5 h 38 min
PR mergées (30 j)
116

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de modelscope/FunASR

Toutes les issues de modelscope/FunASR

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.