Replies: 1 comment 5 replies
-
Awesome thank you @cdpierse One query, is it possible to get WDYT about these enhancements? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Zero-Shot Classification Explainer (#19, #40)
This release introduces a new explainer
ZeroShotClassificationExplainer
that allows for word attributions to be calculated in a zero shot manner with the appropriate NLI type models. To achieve this we implement zero shot exactly how the hugging face team did based off the following paper. A list of compatible models with this explainer can be found at the transformers model hub.Below is an example of instantiating and calling the
ZeroShotClassificationExplainer
:Which will return the following list of tuples:
We can find out which label was predicted with:
For the
ZeroShotClassificationExplainer
the visualize() method returns a table similar to theSequenceClassificationExplainer
.Custom Labels For Sequence Classification - @lalitpagaria (#25, #41 )
This contribution by @lalitpagaria adds the ability to add custom class labels that replace the default labels originally found in the models's config.
This is a very useful addition as it is quite common for popular trained models to have not set the label names resulting in labels that look like
"LABEL_0", "LABEL_1",...
. This can make the sequence classification explainer visualization particularly hard to understand and not very readable.Custom labels are passed to the
SequenceClassificationExplainers
's constructor and the number of labels passed must equal the number of already existing labels:Now the class at the 0th index corresponds to the label "sad" and the class at the 1st index corresponds to "happy".
This is a really nice addition that makes Transformers Interpret more usable with a whole range sequence classification models that don't have labels set. Thanks @lalitpagaria .
General Cleanup and Housekeeping
This discussion was created from the release v0.4.0 - ZeroShotClassificationExplainer, Custom Labels for SequenceClassificationExplainer.
Beta Was this translation helpful? Give feedback.
All reactions