Run this model with HF Jobs

Run polodealvarado/spanclass on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/polodealvarado/spanclass. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/polodealvarado/spanclass on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("zero-shot-classification", model="polodealvarado/spanclass")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("polodealvarado/spanclass", device_map="auto")
Quick Links

Zero-Shot Text Classification — spanclass

GLiNER-inspired span-attentive classification with top-K span selection.

This model encodes texts and candidate labels into a shared embedding space using BERT, enabling classification into arbitrary categories without retraining for new labels.

Training Details

Parameter Value
Base model bert-base-uncased
Model variant spanclass
Training steps 1000
Batch size 2
Learning rate 2e-05
Trainable params 111,254,017
Training time 374.1s

Dataset

Trained on polodealvarado/zeroshot-classification.

Evaluation Results

Metric Score
Precision 0.9277
Recall 0.9503
F1 Score 0.9388

Usage

from models.spanclass import SpanClassModel

model = SpanClassModel.from_pretrained("polodealvarado/spanclass")

predictions = model.predict(
    texts=["The stock market crashed yesterday."],
    labels=[["Finance", "Sports", "Biology", "Economy"]],
)
print(predictions)
# [{"text": "...", "scores": {"Finance": 0.98, "Economy": 0.85, ...}}]
Downloads last month
43
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for polodealvarado/spanclass

Finetuned
(7,305)
this model

Dataset used to train polodealvarado/spanclass

Collection including polodealvarado/spanclass