Downloads · 30 days
20
26% of all-time downloads
shimogerald/bert-base-uncased-mrpc
bert-base-uncased-mrpc is a text classification model from shimogerald. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of bert-base-uncased on the GLUE MRPC dataset (paraphrase detection — predict whether two sentences are equivalent).
Downloads · 30 days
20
26% of all-time downloads
All-time downloads
76
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of bert-base-uncased on the GLUE MRPC dataset (paraphrase detection — predict whether two sentences are equivalent).
On the MRPC validation set:
| Metric | Value |
|---|---|
| Accuracy | 0.8750 |
| F1 | 0.9119 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("shimogerald/bert-base-uncased-mrpc")
model = AutoModelForSequenceClassification.from_pretrained("shimogerald/bert-base-uncased-mrpc")
inputs = tokenizer("The cat sat on the mat.", "A cat is sitting on a mat.",
return_tensors="pt", truncation=True)
with torch.no_grad():
logits = model(**inputs).logits
pred = torch.argmax(logits, dim=1).item()
print("equivalent" if pred == 1 else "not equivalent")