-
Notifications
You must be signed in to change notification settings - Fork 3k
Support multilabel metrics #2589
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
Conversation
|
Hi ! Thanks for the fix :) If I understand correctly, For example, I tested this and it raises an error: import datasets as ds
import pyarrow as pa
features = ds.Features({"a": ds.features.OptionalSequence(ds.Value("int32"))})
batch = {"a": [[0]]}
writer = ds.ArrowWriter(features=features, stream=pa.BufferOutputStream())
writer.write_batch(batch)
# ArrowInvalid: Could not convert [0] with type list: tried to convert to intThis error happens because Another way to add support for multilabel would be to have several configurations for these metrics. By default it would set the features without sequences, and for the multi label configuration it would use features with sequences. Let me know what you think |
|
Hi @lhoestq, thanks for your feedback :) Definitely, your suggested approach is simpler. I am going to refactor all my PR unless we could envision some other use cases where an OptionalSequence might be convenient, but for now I can't think of any... |
lhoestq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks :)
|
@albertvillanova @lhoestq I couldnt find the related docs in F1 card: https://huggingface.co/spaces/evaluate-metric/f1 How do I perform multilabel F1 evaluation using evaluate package? |
|
I was going to transfer your question to the Thanks, @fcakyon. |
|
Sorry to bomb you on multiple channels 😅 @albertvillanova, I have solved my problems, and opened a PR so that others also don't get confused 👍 |
Currently, multilabel metrics are not supported because
predictionsandreferencesare defined asValue("int32").This PR creates a new feature type
OptionalSequencewhich can act as eitherValue("int32")orSequence(Value("int32")), depending on the data passed.Close #2554.