You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@lalitpagaria that would be really helpful thanks. So because this only applies to sequence classification tasks I think the best place to implement this would be in the __init__ of the SequenceClassificationExplainer.
Where custom_id2label is a optional parameter that can passed and will set the new values. I don't think you even need to overwrite id2label on the HF model's config itself because the classification explainer sets these as attributes itself so changing it for the explainer should do, I try as much as possible not to interfere with HF model itself.
Some other things that would be nice to do before actually setting the new values would be to check that the length of custom_id2label.keys() matches the existing length. In a case where a user accidentally sets too few or too many labels I would see it raising some sort of value error.
Another thing that this has got me thinking is that once the new id2label is set it would be to set label2id with the inverse values.
Thanks for volunteering to help on this, let me know if you need any further guidance.
No description provided.
The text was updated successfully, but these errors were encountered: