compute_det_ctc make_pair drops transcript words that equal the utterance id

Abierto
#3,978 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@nurlanmnn ya está trabajando en esto.

Desde el 29/11/2026.

  • #3979 de @nurlanmnn — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, pytorch

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
21.2k
Forks
2.2k
Merge medio
5 h 38 min
PR fusionados (30 d)
116

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelscope/FunASR

Todos los issues de modelscope/FunASR

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.