Skip to content

Zero shot classifier with interpret text #179

@subhamkhemka

Description

@subhamkhemka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions