polodealvarado/zero-shot-text-classification
Viewer • Updated • 1k • 19
How to use polodealvarado/late_interaction with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("zero-shot-classification", model="polodealvarado/late_interaction") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("polodealvarado/late_interaction", dtype="auto")ColBERT-style token-level MaxSim scoring for fine-grained alignment.
This model encodes texts and candidate labels into a shared embedding space using BERT, enabling classification into arbitrary categories without retraining for new labels.
| Parameter | Value |
|---|---|
| Base model | bert-base-uncased |
| Model variant | late_interaction |
| Training steps | 1000 |
| Batch size | 2 |
| Learning rate | 2e-05 |
| Trainable params | 109,580,672 |
| Training time | 354.7s |
Trained on polodealvarado/zeroshot-classification.
| Metric | Score |
|---|---|
| Precision | 0.8546 |
| Recall | 0.9686 |
| F1 Score | 0.9081 |
from models.late_interaction import LateInteractionModel
model = LateInteractionModel.from_pretrained("polodealvarado/late_interaction")
predictions = model.predict(
texts=["The stock market crashed yesterday."],
labels=[["Finance", "Sports", "Biology", "Economy"]],
)
print(predictions)
# [{"text": "...", "scores": {"Finance": 0.98, "Economy": 0.85, ...}}]
Base model
google-bert/bert-base-uncased