Views
No views yet
| Model | Dataset | Epochs | Eval Loss | Accuracy | Precision | Recall | F1 | Train Loss | Train Runtime | Eval Runtime |
|---|---|---|---|---|---|---|---|---|---|---|
| Prefix-Tuned BERT (tomaarsen/bert-base-nq-prompts) | Quora | 15 | 0.2891 | 0.8763 | 0.8070 | 0.8720 | 0.8382 | 0.3222 | 1664.56s | 19.59s |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3model_name = "mia-project-2025/bert-base-uncased-adapter-quora-question-pairs"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForSequenceClassification.from_pretrained(model_name)
6
7# Example input
8questions = ["How do I learn Python?", "What is the best way to learn Python?"]
9inputs = tokenizer(questions[0], questions[1], return_tensors="pt", padding=True, truncation=True)
10
11# Prediction
12outputs = model(**inputs)
13pred = outputs.logits.argmax(-1).item()
14print("Duplicate" if pred == 1 else "Not Duplicate")
15