Downloads · 30 days
32
4% of all-time downloads
dleemiller/finecat-nli-m
finecat-nli-m is a text classification model from dleemiller. Use it when you need a label for a piece of text. It is set up for sentence-transformers.
<p align="center" <img src="https://cdn-uploads.huggingface.co/production/uploads/65ff92ea467d83751a727538/JzqCZCyRYGrVgbto3eRr.png" style="width: 400px;" </p
Downloads · 30 days
32
4% of all-time downloads
All-time downloads
782
Public
Parameters
150M
598 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors598 MB · 99%
From the Hugging Face model README
This model is a fine-tune of the excellent tasksource/ModernBERT-base-nli,
trained on the dleemiller/FineCat-NLI dataset—a compilation of several high-quality
NLI data sources with quality screening and reduction of easy samples in the training split.
The training also incorporates logit distillation from dleemiller/finecat-nli-l.
Distillation loss looks like this: $$ \begin{equation} \mathcal{L} = \alpha \cdot \mathcal{L}{\text{CE}}(z^{(s)}, y) + \beta \cdot \mathcal{L}{\text{MSE}}(z^{(s)}, z^{(t)}) \end{equation} $$
where \(z^{(s)}\) and \(z^{(t)}\) are the student and teacher logits, \(y\) are the ground truth labels, and \(\alpha\) and \(\beta\) are equally weighted at 0.5.
This model and dataset specifically targets improving NLI, through high quality sources. The tasksource models are the best checkpoints to start from, although training from ModernBERT is also competitive.
F1-Micro scores (equivalent to accuracy) for each dataset. Performance was measured at bs=32 using a Nvidia Blackwell PRO 6000 Max-Q.
| Model | finecat | mnli | mnli_mismatched | snli | anli_r1 | anli_r2 | anli_r3 | wanli | lingnli | Throughput (samples/s) | Peak GPU Mem (MB) |
|---|---|---|---|---|---|---|---|---|---|---|---|
dleemiller/finecat-nli-m | 0.8000 | 0.8917 | 0.9103 | 0.9126 | <u>0.6760</u> | <u>0.5000</u> | <u>0.4717</u> | 0.7418 | <u>0.8419</u> | 1323.13 | 807.46 |
MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli | <u>0.7642</u> | 0.9033 | 0.9028 | 0.8866 | 0.7120 | 0.5470 | 0.4950 | 0.6418 | 0.8523 | 1278.18 | 1644.80 |
tasksource/ModernBERT-base-nli | 0.7595 | 0.8685 | 0.8979 | 0.8915 | 0.6300 | 0.4820 | 0.4192 | <u>0.6632</u> | 0.8118 | 1338.37 | 805.87 |
dleemiller/ModernCE-base-nli | 0.7533 | 0.8923 | <u>0.9035</u> | <u>0.9187</u> | 0.5240 | 0.3950 | 0.3333 | 0.6464 | 0.8282 | 1338.31 | 805.87 |
cross-encoder/nli-deberta-v3-base | 0.7467 | <u>0.9001</u> | 0.9004 | 0.9238 | 0.4340 | 0.3500 | 0.3408 | 0.6378 | 0.8346 | 1263.70 | 1644.80 |
cross-encoder/nli-distilroberta-base | 0.6936 | 0.8365 | 0.8398 | 0.8996 | 0.2660 | 0.2810 | 0.2975 | 0.5516 | 0.7516 | 2733.10 | 566.64 |
entailment: 0neutral: 1contradiction: 2First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load the model and run inference.
from sentence_transformers import CrossEncoder
import numpy as np
model = CrossEncoder("dleemiller/finecat-nli-l")
id2label = model.model.config.id2label # {0:'entailment', 1:'neutral', 2:'contradiction'}
pairs = [
("The glass fell off the counter and shattered on the tile.",
"The glass broke when it hit the floor."), # E
("The store opens at 9 a.m. every day.",
"The store opens at 7 a.m. on weekdays."), # C
("A researcher presented results at the conference.",
"The presentation won the best paper award."), # N
("It started raining heavily, so the match was postponed.",
"The game was delayed due to weather."), # E
("Every seat on the flight was taken.",
"There were several empty seats on the plane."), # C
]
logits = model.predict(pairs) # shape: (5, 3)
for (prem, hyp), row in zip(pairs, logits):
pred_idx = int(np.argmax(row))
pred = id2label[pred_idx]
print(f"[{pred}] Premise: {prem} | Hypothesis: {hyp}")
We thank the creators and contributors of tasksource and MoritzLaurer for making their work available.
This model would not be possible without their efforts and open source contributions.
@misc{nli-compiled-2025,
title = {FineCat NLI Dataset},
author = {Lee Miller},
year = {2025},
howpublished = {Refined compilation of 6 major NLI datasets}
}