Downloads · 30 days
33
23% of all-time downloads
polodealvarado/projection_biencoder
projection_biencoder is a zero-shot classification model from polodealvarado. Use it when you need labels you did not train the model on. It is set up for transformers. The card lists the license as mit.
CLIP-inspired with projection heads, L2 norm, and learnable temperature.
Downloads · 30 days
33
23% of all-time downloads
All-time downloads
146
Public
Parameters
110M
439 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors439 MB · 100%
From the Hugging Face model README
CLIP-inspired with projection heads, L2 norm, and learnable temperature.
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 | projection_biencoder |
| Training steps | 1000 |
| Batch size | 2 |
| Learning rate | 2e-05 |
| Trainable params | 109,679,105 |
| Training time | 318.3s |
Trained on polodealvarado/zeroshot-classification.
| Metric | Score |
|---|---|
| Precision | 0.9431 |
| Recall | 0.9826 |
| F1 Score | 0.9624 |
from models.projection import ProjectionBiEncoderModel
model = ProjectionBiEncoderModel.from_pretrained("polodealvarado/projection_biencoder")
predictions = model.predict(
texts=["The stock market crashed yesterday."],
labels=[["Finance", "Sports", "Biology", "Economy"]],
)
print(predictions)
# [{"text": "...", "scores": {"Finance": 0.98, "Economy": 0.85, ...}}]