Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I verified the scoring fix on this head. In an offline run of the actual DET CLI with a generated WAV and synthetic keyword scores, the old code exited 0 but omitted the expected keyword statistics; your change preserved the repeated ID and produced the expected statistics. This validates the evaluator, not recognition accuracy. The remaining integration gap is hosted coverage: no Actions suite is attached to this revision. Could you include the following small change on this PR? It selects the scorer and its tests on pull requests and main, checks out the exact PR head and runs the six new cases alongside the existing KWS suite. I applied this diff to Tested workflow diff--- a/.github/workflows/test-kws-output.yml
+++ b/.github/workflows/test-kws-output.yml
@@ -12,6 +12,8 @@
- "funasr/auto/auto_model.py"
- "funasr/utils/datadir_writer.py"
- "funasr/utils/kws_utils.py"
+ - "funasr/utils/compute_det_ctc.py"
+ - "tests/test_compute_det_ctc_make_pair.py"
- "tests/test_kws_optional_output.py"
- "tests/test_kws_streaming_continuity.py"
- "tests/test_kws_utils.py"
@@ -32,6 +34,8 @@
- "funasr/auto/auto_model.py"
- "funasr/utils/datadir_writer.py"
- "funasr/utils/kws_utils.py"
+ - "funasr/utils/compute_det_ctc.py"
+ - "tests/test_compute_det_ctc_make_pair.py"
- "tests/test_kws_optional_output.py"
- "tests/test_kws_streaming_continuity.py"
- "tests/test_kws_utils.py"
@@ -53,6 +57,8 @@
MKL_NUM_THREADS: "1"
steps:
- uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
@@ -67,6 +73,7 @@
tests/test_kws_optional_output.py \
tests/test_kws_streaming_continuity.py \
tests/test_kws_utils.py \
+ tests/test_compute_det_ctc_make_pair.py \
tests/test_wav_frontend_no_lfr.py \
tests/test_fsmn_vad_streaming_buffers.py \
tests/test_dynamic_streaming_vad.py \ |
Trigger the KWS output workflow on changes to compute_det_ctc.py and its tests, check out the exact PR head, and add tests/test_compute_det_ctc_make_pair.py to the pytest selection, as suggested in review. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Summary
Fixes #3978
make_pair()infunasr/utils/compute_det_ctc.pytook the transcript withline.replace(arr[0], ''), which removes the utterance id everywhere in the line. When the id also shows up in the transcript (1 turn on light 1,go go go forward), those words were lost. Now it takes everything after the first field instead.Type of change
Validation
python -m pytest tests/test_compute_det_ctc_make_pair.py -q: 6 passed. It covers ids that appear in the transcript, an id that is a prefix of a word, extra spaces and tabs, and the skipped/unmatched lines. 4 cases fail on main and all pass with the fix.python -m compileallon the changed file is clean.User impact
KWS scoring with
compute_det_ctc.pynow uses the full transcript, so utterances whose id matches a word in the text are classed correctly as keyword or filler.Notes for reviewers
One-line change. Spacing inside the transcript is kept as before. The test loads
make_pairfrom the file so it runs without the audio dependencies.🤖 Generated with Claude Code