[WER] Better error message for wer
{'login': 'patrickvonplaten', 'id': 23423619, 'node_id': 'MDQ6VXNlcjIzNDIzNjE5', 'avatar_url': 'https://avatars.githubusercontent.com/u/23423619?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/patrickvonplaten', 'html_url': 'https://github.com/patrickvonplaten', 'followers_url': 'https://api.github.com/users/patrickvonplaten/followers', 'following_url': 'https://api.github.com/users/patrickvonplaten/following{/other_user}', 'gists_url': 'https://api.github.com/users/patrickvonplaten/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/patrickvonplaten/subscriptions', 'organizations_url': 'https://api.github.com/users/patrickvonplaten/orgs', 'repos_url': 'https://api.github.com/users/patrickvonplaten/repos', 'events_url': 'https://api.github.com/users/patrickvonplaten/events{/privacy}', 'received_events_url': 'https://api.github.com/users/patrickvonplaten/received_events', 'type': 'User', 'site_admin': False}
[]
[]
['Hi ! I don\'t think this would solve this issue.\r\nCurrently it looks like there\'s a bug that converts the list `["hello it\'s nice"]` to a string `\'["hello it\'s nice"]\'` since this is what the metric expects as input. The conversion is done before the data are passed to `_compute()`.\r\n\r\nThis is `Value("string").encode_example` that is called to do the conversion. Since `str()` encoding is too permissive we should consider raising an error if the example is not a string (even though it can be converted to string). '
 "> called\r\n\r\nAh yeah you're right"
 'I just opened https://github.com/huggingface/datasets/pull/3460 to fix that. It now raises an error instead of computing the wrong WER'
 'Thank you - that should be good enough!']
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/3456', 'html_url': 'https://github.com/huggingface/datasets/pull/3456', 'diff_url': 'https://github.com/huggingface/datasets/pull/3456.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/3456.patch', 'merged_at': None}
Currently we have the following problem when using the WER. When the input format to the WER metric is wrong, instead of throwing an error message a word-error-rate is computed which is incorrect. E.g. when doing the following: 


```python
from datasets import load_metric

wer = load_metric("wer")

target_str = ["hello this is nice", "hello the weather is bloomy"]
pred_str = [["hello it's nice"], ["hello it's the weather"]]

print("Wrong:", wer.compute(predictions=pred_str, references=target_str))
print("Correct", wer.compute(predictions=[x[0] for x in pred_str], references=target_str))
```
We get:
```
Wrong: 1.0
Correct 0.5555555555555556
```

meaning that we get a word-error rate for incorrectly passed input formats. We should raise an error here instead so that people don't spent hours fixing a model while it's their incorrect evaluation metric is the problem for a low WER.
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3456/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}