Downloads · 30 days
61
0% of all-time downloads
navteca/bart-large-mnli
bart-large-mnli is a zero-shot classification model from navteca. Use it when you need labels you did not train the model on. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
61
0% of all-time downloads
All-time downloads
14.1K
Public
Repo size
4.9 GB
Likes
4
Public
Click a slice to open those files.
.bin1.6 GB · 50%
From the Hugging Face model README
This model uses bart-large.
This model was trained on the MultiNLI (MNLI) dataset in the manner originally described in Yin et al. 2019.
It can be used to predict whether a topic label can be assigned to a given sequence, whether or not the label has been seen before.
The trained model can be used like this:
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
# Load model & tokenizer
bart_model = AutoModelForSequenceClassification.from_pretrained('navteca/bart-large-mnli')
bart_tokenizer = AutoTokenizer.from_pretrained('navteca/bart-large-mnli')
# Get predictions
nlp = pipeline('zero-shot-classification', model=bart_model, tokenizer=bart_tokenizer)
sequence = 'One day I will see the world.'
candidate_labels = ['cooking', 'dancing', 'travel']
result = nlp(sequence, candidate_labels, multi_label=True)
print(result)
#{
# "sequence": "One day I will see the world.",
# "labels": [
# "travel",
# "dancing",
# "cooking"
# ],
# "scores": [
# 0.9941897988319397,
# 0.0060537424869835,
# 0.0020010927692056
# ]
#}