Downloads · 30 days
10
1% of all-time downloads
ajayat/xlm-roberta-large-xnli
xlm-roberta-large-xnli is a text classification model from ajayat. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
- Developed by: Adrien J. - Model type: XLM-RoBERTa - Languages (NLP): Multilingual - Finetuned from model: FacebookAI/xlm-roberta-large
Downloads · 30 days
10
1% of all-time downloads
All-time downloads
861
Public
Parameters
560M
2.3 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.2 GB · 99%
From the Hugging Face model README
This model is ready-to-use for text classification.
import pandas as pd
from transformers import pipeline
# Load the classification pipeline
classifier = pipeline("text-classification", "ajayat/xlm-roberta-large-xnli")
classifier.model.config.id2label = {
0: "entailment",
1: "neutral",
2: "contradiction"
}
# Example premise and hypothesis
premise = "A soccer game with multiple males playing."
hypothesis = "Some men are playing a sport."
# Provide input as a dictionary with text and text_pair keys
result = classifier({'text': premise, 'text_pair': hypothesis}, top_k=None)
pd.DataFrame(result)
| label | score | |
|---|---|---|
| 0 | entailment | 0.996513 |
| 1 | neutral | 0.003228 |
| 2 | contradiction | 0.000260 |
The XNLI dataset (Cross-lingual Natural Language Inference) is a benchmark dataset created by Facebook AI for evaluating cross-lingual understanding. It extends the MultiNLI corpus by translating 7,500 human-annotated English sentence pairs (premise and hypothesis) into 14 languages.
Each pair is labeled as entailment, contradiction, or neutral.
bf16 mixed precision642e-5Here are the results on the XNLI test set:
| lang_abv | ar | bg | de | el | en | es | fr | hi | ru | sw | th | tr | ur | vi | zh | avg |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| accuracy | 0.82 | 0.85 | 0.85 | 0.85 | 0.89 | 0.85 | 0.84 | 0.81 | 0.83 | 0.77 | 0.81 | 0.82 | 0.77 | 0.83 | 0.83 | 0.84 |
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).