Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jiwer with wrong numpy version induces hang without reported wrong information #118

Open
L-Absente opened this issue Feb 23, 2025 · 0 comments

Comments

@L-Absente
Copy link

Firstly, with jiwer=1.3.2 and numpy=2.0.2,
wer = jiwer.wer(truth, hypothesis, standardize=True) would stuck in
Traceback (most recent call last):
File "/root/conformer/EfficientConformer/main.py", line 227, in
main(args)
File "/root/conformer/EfficientConformer/main.py", line 128, in main
model.fit(dataset_train,
^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/conformer/EfficientConformer/models/model.py", line 313, in fit
wer, truths, preds, val_loss = self.evaluate(dataset, val_steps, verbose_val, eval_loss=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/conformer/EfficientConformer/models/model.py", line 502, in evaluate
wer = jiwer.wer(speech_true, speech_pred, standardize=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/jiwer/wer.py", line 75, in wer
distance = _edit_distance(t, h)
^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/jiwer/wer.py", line 252, in _edit_distance
m[i, j] = min(
^^^^
But it never reported wrong information

Solution:
update jiwer's version and
change
wer = jiwer.wer(truth, hypothesis, standardize=True)
into
transformation = jiwer.Compose([
jiwer.RemoveWhiteSpace(),
jiwer.ToLowerCase(),
jiwer.ReduceToListOfListOfWords(word_delimiter=" ")
])
wer = jiwer.wer(truth, hypothesis, truth_transform=transformation, hypothesis_transform=transformation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant