Instructions to use davanstrien/dataset-rows-task-classifier-2048 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davanstrien/dataset-rows-task-classifier-2048 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="davanstrien/dataset-rows-task-classifier-2048", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("davanstrien/dataset-rows-task-classifier-2048", trust_remote_code=True) model = AutoModelForSequenceClassification.from_pretrained("davanstrien/dataset-rows-task-classifier-2048", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- uv-script
|
| 4 |
+
- text-classification
|
| 5 |
+
- hf-jobs
|
| 6 |
+
base_model: LiquidAI/LFM2.5-Encoder-350M
|
| 7 |
+
datasets:
|
| 8 |
+
- davanstrien/dataset-rows-with-task-categories
|
| 9 |
+
pipeline_tag: text-classification
|
| 10 |
+
library_name: transformers
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# dataset-rows-task-classifier-2048
|
| 14 |
+
|
| 15 |
+
[LiquidAI/LFM2.5-Encoder-350M](https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M) fine-tuned for
|
| 16 |
+
multi-label text classification on
|
| 17 |
+
[davanstrien/dataset-rows-with-task-categories](https://huggingface.co/datasets/davanstrien/dataset-rows-with-task-categories).
|
| 18 |
+
|
| 19 |
+
- **Labels (35)**: `audio-classification`, `audio-to-audio`, `automatic-speech-recognition`, `feature-extraction`, `fill-mask`, `image-classification`, `image-feature-extraction`, `image-segmentation`, `image-text-to-text`, `image-to-3d`, `image-to-image`, `image-to-text`, `multiple-choice`, `object-detection`, `question-answering`, `reinforcement-learning`, `robotics`, `sentence-similarity`, `summarization`, `table-question-answering`, `tabular-classification`, `tabular-regression`, `text-classification`, `text-generation`, `text-retrieval`, `text-to-image`, `text-to-speech`, `text-to-video`, `time-series-forecasting`, `token-classification`, … (35 total)
|
| 20 |
+
- **Date**: 2026-07-29 18:35 UTC
|
| 21 |
+
|
| 22 |
+
> [!NOTE]
|
| 23 |
+
> This model uses a custom classification head (mean pooling over a backbone without a native sequence-classification class), so loading requires `trust_remote_code=True`. vLLM serving requires a standard architecture.
|
| 24 |
+
|
| 25 |
+
## Evaluation
|
| 26 |
+
|
| 27 |
+
| Metric | Value |
|
| 28 |
+
|--------|-------|
|
| 29 |
+
| f1_micro @ 0.5 | 0.6218 |
|
| 30 |
+
| f1_macro @ 0.5 | 0.4621 |
|
| 31 |
+
| f1_micro @ tuned | 0.6486 |
|
| 32 |
+
| f1_macro @ tuned | 0.5594 |
|
| 33 |
+
|
| 34 |
+
Per-label decision thresholds tuned on the eval split are stored in
|
| 35 |
+
`config.classifier_thresholds`.
|
| 36 |
+
|
| 37 |
+
**Choosing an operating point**: the stored thresholds maximise per-label F1. For
|
| 38 |
+
precision-first use (e.g. auto-applying labels), act only on predictions well above
|
| 39 |
+
their threshold — sigmoid probabilities are a usable confidence signal, and filtering
|
| 40 |
+
to high-confidence predictions trades coverage for precision. Route the rest to review.
|
| 41 |
+
|
| 42 |
+
## Usage
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
import torch
|
| 46 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 47 |
+
|
| 48 |
+
model = AutoModelForSequenceClassification.from_pretrained("davanstrien/dataset-rows-task-classifier-2048", trust_remote_code=True)
|
| 49 |
+
tokenizer = AutoTokenizer.from_pretrained("davanstrien/dataset-rows-task-classifier-2048", trust_remote_code=True)
|
| 50 |
+
|
| 51 |
+
inputs = tokenizer("your text here", return_tensors="pt", truncation=True)
|
| 52 |
+
probs = torch.sigmoid(model(**inputs).logits)[0]
|
| 53 |
+
thresholds = torch.tensor(model.config.classifier_thresholds) # tuned on validation
|
| 54 |
+
labels = [model.config.id2label[i] for i in (probs >= thresholds).nonzero().flatten().tolist()]
|
| 55 |
+
print(labels)
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Reproduction
|
| 59 |
+
|
| 60 |
+
Produced on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs) (`gpu`) with the [`train-classifier.py`](https://huggingface.co/datasets/uv-scripts/classification/raw/main/train-classifier.py) recipe from [uv-scripts](https://huggingface.co/uv-scripts). Run it yourself:
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
hf jobs uv run --flavor gpu --secrets HF_TOKEN \
|
| 64 |
+
https://huggingface.co/datasets/uv-scripts/classification/raw/main/train-classifier.py \
|
| 65 |
+
davanstrien/dataset-rows-with-task-categories davanstrien/dataset-rows-task-classifier-2048 --label-column labels
|
| 66 |
+
```
|