Views
No views yet
| Metric | Matched (in-domain) | Mismatched (out-of-domain) |
|---|---|---|
| Eval Loss | 0.5139 | 0.4987 |
| Accuracy | 84.46% | 84.46% |
| Precision | 0.8473 | 0.8467 |
| Recall | 0.8446 | 0.8446 |
| F1 Score | 0.8453 | 0.8453 |
| Train Loss | 0.7036 | 0.7036 |
| Train Runtime | 2936.98s | 2936.98s |
| Eval Runtime | 4.7s | 4.8s |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3model_name = "mia-project-2025/bert-base-uncased-finetuned-glue-mnli"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForSequenceClassification.from_pretrained(model_name)
6
7# Example input
8premise = "A soccer game with multiple males playing."
9hypothesis = "Some men are playing a sport."
10inputs = tokenizer(premise, hypothesis, return_tensors="pt", padding=True, truncation=True)
11
12# Prediction
13outputs = model(**inputs)
14pred = outputs.logits.argmax(-1).item()
15labels = ["entailment", "neutral", "contradiction"]
16print("Prediction:", labels[pred])