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

wer_standardize error #97

Open
em-chiu opened this issue Nov 6, 2024 · 2 comments
Open

wer_standardize error #97

em-chiu opened this issue Nov 6, 2024 · 2 comments

Comments

@em-chiu
Copy link

em-chiu commented Nov 6, 2024

I used the below code to try and process the data but got a ValueError

import jiwer

string_wer_data["standardized_ref"] = jiwer.wer_standardize((string_wer_data["reference"]))
string_wer_data["standardized_hyp"] = jiwer.wer_standardize((string_wer_data["hypothesis"]))

emulating nikvaessen's response to another issue:

import jiwer

jiwer.wer(
  outputs_true, 
  outputs_pred,
  reference_transform=jiwer.wer_standardize, 
  hypothesis_transform=jiwer.wer_standardize
)

Originally posted by @nikvaessen in #85 (comment)

ValueError:

Traceback (most recent call last):
  File "/Users/emily/Desktop/whisper-input/wer_modules.py", line 73, in <module>
    string_wer_data["standardized_ref"] = jiwer.wer_standardize((string_wer_data["reference"]))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/emily/miniconda3/lib/python3.12/site-packages/jiwer/transforms.py", line 130, in __call__
    text = tr(text)
           ^^^^^^^^
  File "/Users/emily/miniconda3/lib/python3.12/site-packages/jiwer/transforms.py", line 87, in __call__
    raise ValueError(
ValueError: input 0 
@nikvaessen
Copy link
Collaborator

nikvaessen commented Nov 7, 2024

Can you verify the following assertions on string_wer_data["reference"] :

assert isinstance(string_wer_data["reference"], list)
assert all(isinstance(e, str) for e in string_wer_data["reference"])

@em-chiu
Copy link
Author

em-chiu commented Nov 12, 2024

i verified those assertions are true

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

2 participants