interpret-text icon indicating copy to clipboard operation
interpret-text copied to clipboard

Zero shot classifier with interpret text

Open subhamkhemka opened this issue 2 years ago • 0 comments

Hi

I am using the huggingface transformers zero shot classification pipeline.

from transformers import pipeline
classifier = pipeline("zero-shot-classification",
                      model="facebook/bart-large-mnli")
sequence_to_classify = "one day I will see the world"
candidate_labels = ['travel', 'cooking', 'dancing']
classifier(sequence_to_classify, candidate_labels)

I would like to use the word importance feature of the interpret-text module to get the important words for the predicted label.

Can you please help on how I could do this ?

Thanks, Subham

subhamkhemka avatar Sep 16 '21 07:09 subhamkhemka