Views
No views yet
xlm-roberta-large for multilingual textual entailment (Natural Language Inference) on English and Korean text.xlm-roberta-large| Metric | Score |
|---|---|
| F1 Score (weighted) | 0.8800 |
| Accuracy | 0.8800 |
accuracy 0.88 25736
macro avg 0.88 0.88 0.88 257361from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model and tokenizer
5model_name = "bekalebendong/xlm-roberta-large-text-entailment-88"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForSequenceClassification.from_pretrained(model_name)
8
9# Example inference
10premise = "Orsay is one of the few Paris museums that is air-conditioned."
11hypothesis = "The Orsay museum has air conditioning."
12
13# Tokenize
14inputs = tokenizer(premise, hypothesis, return_tensors="pt", truncation=True, max_length=192)
15
16# Predict
17with torch.no_grad():
18 outputs = model(**inputs)
19 predictions = torch.softmax(outputs.logits, dim=1)
20 label = torch.argmax(predictions, dim=1).item()
21
22# Map to label
23label_map = {0: "entailment", 1: "neutral", 2: "contradiction"}
24print(f"Prediction: {label_map[label]} (confidence: {predictions[0][label]:.4f})")1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="bekalebendong/xlm-roberta-large-text-entailment-88",
6 tokenizer="bekalebendong/xlm-roberta-large-text-entailment-88"
7)
8
9result = classifier(
10 "Orsay is one of the few Paris museums that is air-conditioned.",
11 "The Orsay museum has air conditioning."
12)
13print(result)1@misc{xlm-roberta-text-entailment,
2 author = {Your Name},
3 title = {Multilingual Textual Entailment with XLM-RoBERTa},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/bekalebendong/xlm-roberta-large-text-entailment-88}}
7}