Instructions to use textattack/bert-base-uncased-snli with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use textattack/bert-base-uncased-snli with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="textattack/bert-base-uncased-snli")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("textattack/bert-base-uncased-snli") model = AutoModelForSequenceClassification.from_pretrained("textattack/bert-base-uncased-snli") - Notebooks
- Google Colab
- Kaggle
Label Mapping
#2
by Rberg27 - opened
I'm new to huggingface - unsure this is posted somewhere else, but here's the label mapping for this model:
TEXT_ATTACK_NUM_TO_LABEL_MAP = {
0: "contradiction",
1: "entailment",
2: "neutral"
}
Model runs great - but the mapping is off from the standard SNLI dataset labels of:
LABEL_TO_NUM_MAP = {
"entailment": 0,
"neutral": 1,
"contradiction": 2
}