CoolFace
Modelpublic

FriedGil/rockd-image-relevance-classification

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes5downloads
Model Card

SetFit with BAAI/bge-small-en-v1.5

This is a SetFit model that can be used for Text Classification. This SetFit model uses BAAI/bge-small-en-v1.5 as the Sentence Transformer embedding model. A LogisticRegression instance is used for classification.

The model has been trained using an efficient few-shot learning technique that involves:

  1. 1.Fine-tuning a Sentence Transformer with contrastive learning.
  2. 2.Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

  • Model Type: SetFit
  • Sentence Transformer body: BAAI/bge-small-en-v1.5
  • Classification head: a LogisticRegression instance
  • Maximum Sequence Length: 512 tokens
  • Number of Classes: 2 classes <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Model Labels

LabelExamples
0<ul><li>'Calcite'</li><li>'biotite. Contact metamorphosis'</li><li>'rail trail'</li></ul>
1<ul><li>'Geafitti on tree and burn scar on ground'</li><li>'another beautiful rock from the same place'</li><li>'Vhfgv'</li></ul>

Uses

Direct Use for Inference

First install the SetFit library:

bash
pip install setfit

Then you can load this model and run inference.

python
from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("setfit_model_id")
# Run inference
preds = model("scenic overview")

<!--

Downstream Use

List how someone could finetune this model on their own dataset. -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Set Metrics

Training setMinMedianMax
Word count17.27881899
LabelTraining Sample Count
02997
1783

Training Hyperparameters

  • batch_size: (32, 32)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 20
  • bodylearningrate: (2e-05, 1e-05)
  • headlearningrate: 0.01
  • loss: CosineSimilarityLoss
  • distancemetric: cosinedistance
  • margin: 0.25
  • endtoend: False
  • use_amp: False
  • warmup_proportion: 0.1
  • l2_weight: 0.01
  • seed: 42
  • evalmaxsteps: -1
  • loadbestmodelatend: False

Training Results

EpochStepTraining LossValidation Loss
0.000210.2331-
0.0106500.2391-
0.02121000.238-
0.03171500.2309-
0.04232000.2117-
0.05292500.1879-
0.06353000.1745-
0.07413500.1708-
0.08474000.1402-
0.09524500.1349-
0.10585000.1092-
0.11645500.1031-
0.12706000.0828-
0.13766500.0756-
0.14817000.0587-
0.15877500.0487-
0.16938000.0557-
0.17998500.0456-
0.19059000.0371-
0.20119500.0412-
0.211610000.0382-
0.222210500.0376-
0.232811000.0353-
0.243411500.0346-
0.254012000.0364-
0.264612500.0317-
0.275113000.0374-
0.285713500.0282-
0.296314000.0255-
0.306914500.023-
0.317515000.0287-
0.328015500.025-
0.338616000.0216-
0.349216500.0241-
0.359817000.0234-
0.370417500.0279-
0.381018000.0239-
0.391518500.0199-
0.402119000.0252-
0.412719500.0219-
0.423320000.0228-
0.433920500.0204-
0.444421000.0231-
0.455021500.0144-
0.465622000.0229-
0.476222500.0129-
0.486823000.0219-
0.497423500.0194-
0.507924000.0172-
0.518524500.0177-
0.529125000.0252-
0.539725500.0251-
0.550326000.014-
0.560826500.0204-
0.571427000.0248-
0.582027500.0146-
0.592628000.0191-
0.603228500.0223-
0.613829000.0206-
0.624329500.0163-
0.634930000.0235-
0.645530500.0245-
0.656131000.0199-
0.666731500.0145-
0.677232000.016-
0.687832500.0143-
0.698433000.0206-
0.709033500.0187-
0.719634000.0168-
0.730234500.0148-
0.740735000.0212-
0.751335500.0185-
0.761936000.015-
0.772536500.0187-
0.783137000.0161-
0.793737500.0204-
0.804238000.0182-
0.814838500.0157-
0.825439000.0197-
0.836039500.0133-
0.846640000.0211-
0.857140500.0155-
0.867741000.0197-
0.878341500.0168-
0.888942000.0139-
0.899542500.0132-
0.910143000.018-
0.920643500.014-
0.931244000.017-
0.941844500.0173-
0.952445000.0163-
0.963045500.0178-
0.973546000.0176-
0.984146500.0126-
0.994747000.0194-

Framework Versions

  • Python: 3.12.9
  • SetFit: 1.1.2
  • Sentence Transformers: 4.1.0
  • Transformers: 4.52.4
  • PyTorch: 2.7.1
  • Datasets: 3.6.0
  • Tokenizers: 0.21.1

Citation

BibTeX

bibtex
@article{https://doi.org/10.48550/arxiv.2209.11055,
    doi = {10.48550/ARXIV.2209.11055},
    url = {https://arxiv.org/abs/2209.11055},
    author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
    keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
    title = {Efficient Few-Shot Learning Without Prompts},
    publisher = {arXiv},
    year = {2022},
    copyright = {Creative Commons Attribution 4.0 International}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->