Skip to content

Commit

Permalink
small bugfix and add asr evaluator to doc (#6229)
Browse files Browse the repository at this point in the history
* small fix eval_metrics

Signed-off-by: fayejf <[email protected]>

* fix rng

Signed-off-by: fayejf <[email protected]>

* add asr evaluator to doc

Signed-off-by: fayejf <[email protected]>

---------

Signed-off-by: fayejf <[email protected]>
  • Loading branch information
fayejf authored and web-flow committed Mar 17, 2023
1 parent 7865c52 commit 3bb0002
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/source/tools/asr_evaluator.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ASR Evaluator
========================

ASR evaluator is a tool for thoroughly evaluating the performance of ASR models and other features such as Voice Activity Detection.

See more details in: https://github.com/NVIDIA/NeMo/tree/stable/tools/asr_evaluator
1 change: 1 addition & 0 deletions docs/source/tools/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NeMo provides a set of tools useful for developing Automatic Speech Recognitions
ctc_segmentation
speech_data_explorer
comparison_tool
asr_evaluator


There are also additional NeMo-related tools hosted in separate github repositories:
Expand Down
4 changes: 2 additions & 2 deletions nemo/collections/asr/parts/preprocessing/perturb.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ def __init__(
self._audiodataset = AugmentationDataset(manifest_path, audio_tar_filepaths, shuffle_n)
self._data_iterator = iter(self._audiodataset)

self.rng = rng
random.seed(self.rng) if rng else None
self._rng = rng
random.seed(self._rng) if rng else None

def perturb(self, data):
impulse = read_one_audiosegment(
Expand Down
2 changes: 1 addition & 1 deletion tools/asr_evaluator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def cal_target_metadata_wer(manifest: str, target: str, meta_cfg: DictConfig, ev
raise ValueError("Current only support target metadata belongs to numeric or string ")

for slot_key in slot_wer:
slot_wer[slot_key]['wer'] = slot_wer[slot_key]['errors'] / slot_wer[slot_key]['tokens']
slot_wer[slot_key][eval_metric] = slot_wer[slot_key]['errors'] / slot_wer[slot_key]['tokens']
slot_wer[slot_key]['ins_rate'] = slot_wer[slot_key]['inss'] / slot_wer[slot_key]['tokens']
slot_wer[slot_key]['del_rate'] = slot_wer[slot_key]['dels'] / slot_wer[slot_key]['tokens']
slot_wer[slot_key]['sub_rate'] = slot_wer[slot_key]['subs'] / slot_wer[slot_key]['tokens']
Expand Down

0 comments on commit 3bb0002

Please sign in to comment.