Instructions to use facebook/bart-large-mnli with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/bart-large-mnli with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-mnli") model = AutoModelForSequenceClassification.from_pretrained("facebook/bart-large-mnli") - Inference
- Notebooks
- Google Colab
- Kaggle
Is it possible to determine what part of the input caused the classifier to assign scores to a label?
#9
by dsottimano - opened
Please forgive the noob question but I'd like to understand if we can determine what word(s) in the input caused the score for each label.
Regular output:
{
"sequence": "Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.",
"labels": [
"mobile"
],
"scores": [
0.9600788950920105
]
}
Ideal output:
{
"sequence": "Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.",
"labels": [
"mobile"
],
"scores": [
0.9600788950920105
],
"score_target" : ["mobile"
]
}