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

[BUG] Metrics throwing new error on master since 0.4.0 #519

Closed
jbragg opened this issue Aug 19, 2020 · 2 comments
Closed

[BUG] Metrics throwing new error on master since 0.4.0 #519

jbragg opened this issue Aug 19, 2020 · 2 comments

Comments

@jbragg
Copy link
Contributor

jbragg commented Aug 19, 2020

The following error occurs when passing in references of type List[List[str]] to metrics like bleu.
Wasn't happening on 0.4.0 but happening now on master.

  File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 226, in compute
    self.add_batch(predictions=predictions, references=references)
  File "/usr/local/lib/python3.7/site-packages/nlp/metric.py", line 242, in add_batch
    batch = self.info.features.encode_batch(batch)
  File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in encode_batch
    encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column]
  File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 527, in <listcomp>
    encoded_batch[key] = [encode_nested_example(self[key], cast_to_python_objects(obj)) for obj in column]
  File "/usr/local/lib/python3.7/site-packages/nlp/features.py", line 456, in encode_nested_example
    raise ValueError("Got a string but expected a list instead: '{}'".format(obj))
@jbragg jbragg changed the title Metrics throwing new error on master since 0.4.0 [BUG] Metrics throwing new error on master since 0.4.0 Aug 19, 2020
@jbragg
Copy link
Contributor Author

jbragg commented Aug 19, 2020

Update - maybe this is only failing on bleu because I was not tokenizing inputs to the metric

@jbragg
Copy link
Contributor Author

jbragg commented Aug 19, 2020

Closing - seems to be just forgetting to tokenize. And found the helpful discussion in huggingface/evaluate#105

@jbragg jbragg closed this as completed Aug 19, 2020
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