SetFit with sentence-transformers/paraphrase-MiniLM-L6-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-MiniLM-L6-v2 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. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

Label Examples
navigation
product
service
brand
legal
listing
post
testimonial
account_shop

Uses

Direct Use for Inference

First install the SetFit library:

pip install setfit

Then you can load this model and run inference.

from setfit import SetFitModel

# Download from the ๐Ÿค— Hub
model = SetFitModel.from_pretrained("Wispra-fr/setfit-url-classifier")
# Run inference
preds = model("https://ynspir.com")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 1 1.0 1
Label Training Sample Count
legal 70
brand 86
product 176
service 184
post 133
navigation 53
listing 265
account_shop 38
testimonial 132

Training Hyperparameters

  • batch_size: (32, 32)
  • num_epochs: (5, 5)
  • max_steps: -1
  • sampling_strategy: undersampling
  • num_iterations: 10
  • body_learning_rate: (2e-05, 2e-05)
  • head_learning_rate: 2e-05
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: True
  • warmup_proportion: 0.1
  • max_length: 128
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: False

Training Results

Epoch Step Training Loss Validation Loss
0.0014 1 0.2637 -
0.0141 10 0.2127 -
0.0281 20 0.2137 -
0.0422 30 0.2431 -
0.0563 40 0.2347 -
0.0703 50 0.2264 -
0.0844 60 0.2391 -
0.0985 70 0.2395 -
0.1125 80 0.253 -
0.1266 90 0.2295 -
0.1406 100 0.2281 -
0.1547 110 0.2216 -
0.1688 120 0.2297 -
0.1828 130 0.2471 -
0.1969 140 0.209 -
0.2110 150 0.1998 -
0.2250 160 0.1932 -
0.2391 170 0.1821 -
0.2532 180 0.1894 -
0.2672 190 0.1685 -
0.2813 200 0.163 -
0.2954 210 0.2206 -
0.3094 220 0.1698 -
0.3235 230 0.2171 -
0.3376 240 0.1834 -
0.3516 250 0.1678 -
0.3657 260 0.1537 -
0.3797 270 0.1527 -
0.3938 280 0.1751 -
0.4079 290 0.152 -
0.4219 300 0.1371 -
0.4360 310 0.1403 -
0.4501 320 0.1042 -
0.4641 330 0.1108 -
0.4782 340 0.1003 -
0.4923 350 0.1226 -
0.5063 360 0.1613 -
0.5204 370 0.1259 -
0.5345 380 0.0877 -
0.5485 390 0.1067 -
0.5626 400 0.1143 -
0.5767 410 0.096 -
0.5907 420 0.0557 -
0.6048 430 0.051 -
0.6188 440 0.1339 -
0.6329 450 0.0846 -
0.6470 460 0.0657 -
0.6610 470 0.0812 -
0.6751 480 0.058 -
0.6892 490 0.093 -
0.7032 500 0.0397 -
0.7173 510 0.0932 -
0.7314 520 0.062 -
0.7454 530 0.0595 -
0.7595 540 0.0774 -
0.7736 550 0.0444 -
0.7876 560 0.06 -
0.8017 570 0.0486 -
0.8158 580 0.0708 -
0.8298 590 0.0518 -
0.8439 600 0.0479 -
0.8579 610 0.0511 -
0.8720 620 0.0722 -
0.8861 630 0.0691 -
0.9001 640 0.0841 -
0.9142 650 0.0997 -
0.9283 660 0.0583 -
0.9423 670 0.0264 -
0.9564 680 0.0452 -
0.9705 690 0.0174 -
0.9845 700 0.0448 -
0.9986 710 0.043 -
1.0127 720 0.0801 -
1.0267 730 0.063 -
1.0408 740 0.0376 -
1.0549 750 0.0273 -
1.0689 760 0.0516 -
1.0830 770 0.0317 -
1.0970 780 0.0247 -
1.1111 790 0.0254 -
1.1252 800 0.0213 -
1.1392 810 0.0172 -
1.1533 820 0.0365 -
1.1674 830 0.0247 -
1.1814 840 0.0471 -
1.1955 850 0.0248 -
1.2096 860 0.0711 -
1.2236 870 0.0231 -
1.2377 880 0.0504 -
1.2518 890 0.0477 -
1.2658 900 0.0104 -
1.2799 910 0.0338 -
1.2940 920 0.0116 -
1.3080 930 0.0599 -
1.3221 940 0.0215 -
1.3361 950 0.0418 -
1.3502 960 0.0265 -
1.3643 970 0.0371 -
1.3783 980 0.0334 -
1.3924 990 0.0478 -
1.4065 1000 0.0223 -
1.4205 1010 0.0132 -
1.4346 1020 0.0166 -
1.4487 1030 0.035 -
1.4627 1040 0.0081 -
1.4768 1050 0.0238 -
1.4909 1060 0.0177 -
1.5049 1070 0.009 -
1.5190 1080 0.0296 -
1.5331 1090 0.0323 -
1.5471 1100 0.0237 -
1.5612 1110 0.0298 -
1.5752 1120 0.0592 -
1.5893 1130 0.0052 -
1.6034 1140 0.0112 -
1.6174 1150 0.0477 -
1.6315 1160 0.0356 -
1.6456 1170 0.0324 -
1.6596 1180 0.0412 -
1.6737 1190 0.0484 -
1.6878 1200 0.0262 -
1.7018 1210 0.011 -
1.7159 1220 0.0075 -
1.7300 1230 0.0471 -
1.7440 1240 0.0398 -
1.7581 1250 0.0335 -
1.7722 1260 0.0278 -
1.7862 1270 0.0533 -
1.8003 1280 0.0291 -
1.8143 1290 0.0122 -
1.8284 1300 0.0039 -
1.8425 1310 0.0043 -
1.8565 1320 0.0135 -
1.8706 1330 0.0182 -
1.8847 1340 0.0306 -
1.8987 1350 0.0135 -
1.9128 1360 0.0034 -
1.9269 1370 0.0109 -
1.9409 1380 0.0209 -
1.9550 1390 0.0244 -
1.9691 1400 0.0052 -
1.9831 1410 0.0095 -
1.9972 1420 0.0067 -
2.0113 1430 0.0091 -
2.0253 1440 0.0077 -
2.0394 1450 0.0246 -
2.0534 1460 0.0123 -
2.0675 1470 0.0061 -
2.0816 1480 0.0375 -
2.0956 1490 0.0187 -
2.1097 1500 0.0029 -
2.1238 1510 0.0043 -
2.1378 1520 0.0191 -
2.1519 1530 0.0039 -
2.1660 1540 0.0628 -
2.1800 1550 0.0278 -
2.1941 1560 0.0106 -
2.2082 1570 0.0192 -
2.2222 1580 0.0127 -
2.2363 1590 0.0053 -
2.2504 1600 0.0211 -
2.2644 1610 0.0291 -
2.2785 1620 0.0043 -
2.2925 1630 0.0147 -
2.3066 1640 0.0219 -
2.3207 1650 0.0017 -
2.3347 1660 0.0114 -
2.3488 1670 0.0056 -
2.3629 1680 0.0075 -
2.3769 1690 0.0191 -
2.3910 1700 0.0049 -
2.4051 1710 0.0279 -
2.4191 1720 0.0081 -
2.4332 1730 0.0047 -
2.4473 1740 0.0035 -
2.4613 1750 0.0024 -
2.4754 1760 0.0022 -
2.4895 1770 0.0091 -
2.5035 1780 0.0238 -
2.5176 1790 0.0084 -
2.5316 1800 0.0267 -
2.5457 1810 0.0071 -
2.5598 1820 0.0027 -
2.5738 1830 0.0226 -
2.5879 1840 0.0032 -
2.6020 1850 0.0014 -
2.6160 1860 0.0028 -
2.6301 1870 0.0043 -
2.6442 1880 0.0105 -
2.6582 1890 0.0036 -
2.6723 1900 0.0031 -
2.6864 1910 0.008 -
2.7004 1920 0.0296 -
2.7145 1930 0.0103 -
2.7286 1940 0.0234 -
2.7426 1950 0.0035 -
2.7567 1960 0.0252 -
2.7707 1970 0.0238 -
2.7848 1980 0.0045 -
2.7989 1990 0.0304 -
2.8129 2000 0.0021 -
2.8270 2010 0.0046 -
2.8411 2020 0.0027 -
2.8551 2030 0.0169 -
2.8692 2040 0.0089 -
2.8833 2050 0.0187 -
2.8973 2060 0.0032 -
2.9114 2070 0.0025 -
2.9255 2080 0.0161 -
2.9395 2090 0.0023 -
2.9536 2100 0.0014 -
2.9677 2110 0.004 -
2.9817 2120 0.0061 -
2.9958 2130 0.0227 -
3.0098 2140 0.0012 -
3.0239 2150 0.0377 -
3.0380 2160 0.0145 -
3.0520 2170 0.022 -
3.0661 2180 0.0017 -
3.0802 2190 0.0013 -
3.0942 2200 0.0018 -
3.1083 2210 0.0025 -
3.1224 2220 0.0024 -
3.1364 2230 0.0088 -
3.1505 2240 0.0019 -
3.1646 2250 0.0159 -
3.1786 2260 0.004 -
3.1927 2270 0.0008 -
3.2068 2280 0.0031 -
3.2208 2290 0.0037 -
3.2349 2300 0.0015 -
3.2489 2310 0.0041 -
3.2630 2320 0.0026 -
3.2771 2330 0.0009 -
3.2911 2340 0.0022 -
3.3052 2350 0.0028 -
3.3193 2360 0.0161 -
3.3333 2370 0.0076 -
3.3474 2380 0.0021 -
3.3615 2390 0.0172 -
3.3755 2400 0.0292 -
3.3896 2410 0.0051 -
3.4037 2420 0.0174 -
3.4177 2430 0.0081 -
3.4318 2440 0.0065 -
3.4459 2450 0.0024 -
3.4599 2460 0.0094 -
3.4740 2470 0.0146 -
3.4880 2480 0.004 -
3.5021 2490 0.0044 -
3.5162 2500 0.0016 -
3.5302 2510 0.0032 -
3.5443 2520 0.0289 -
3.5584 2530 0.0123 -
3.5724 2540 0.0055 -
3.5865 2550 0.0031 -
3.6006 2560 0.0081 -
3.6146 2570 0.0042 -
3.6287 2580 0.0051 -
3.6428 2590 0.0058 -
3.6568 2600 0.0017 -
3.6709 2610 0.005 -
3.6850 2620 0.0015 -
3.6990 2630 0.0008 -
3.7131 2640 0.0069 -
3.7271 2650 0.0022 -
3.7412 2660 0.0024 -
3.7553 2670 0.0018 -
3.7693 2680 0.0031 -
3.7834 2690 0.0112 -
3.7975 2700 0.0051 -
3.8115 2710 0.0024 -
3.8256 2720 0.0011 -
3.8397 2730 0.0008 -
3.8537 2740 0.0035 -
3.8678 2750 0.0029 -
3.8819 2760 0.0047 -
3.8959 2770 0.0208 -
3.9100 2780 0.0026 -
3.9241 2790 0.0152 -
3.9381 2800 0.0021 -
3.9522 2810 0.0188 -
3.9662 2820 0.0162 -
3.9803 2830 0.0009 -
3.9944 2840 0.0045 -
4.0084 2850 0.0058 -
4.0225 2860 0.031 -
4.0366 2870 0.0013 -
4.0506 2880 0.0021 -
4.0647 2890 0.0022 -
4.0788 2900 0.008 -
4.0928 2910 0.0107 -
4.1069 2920 0.0015 -
4.1210 2930 0.003 -
4.1350 2940 0.0094 -
4.1491 2950 0.0013 -
4.1632 2960 0.0084 -
4.1772 2970 0.0021 -
4.1913 2980 0.0068 -
4.2053 2990 0.0032 -
4.2194 3000 0.0044 -
4.2335 3010 0.0037 -
4.2475 3020 0.0182 -
4.2616 3030 0.0023 -
4.2757 3040 0.0019 -
4.2897 3050 0.001 -
4.3038 3060 0.0149 -
4.3179 3070 0.0241 -
4.3319 3080 0.0028 -
4.3460 3090 0.0104 -
4.3601 3100 0.0007 -
4.3741 3110 0.0015 -
4.3882 3120 0.0023 -
4.4023 3130 0.0228 -
4.4163 3140 0.0161 -
4.4304 3150 0.0151 -
4.4444 3160 0.0043 -
4.4585 3170 0.0031 -
4.4726 3180 0.0041 -
4.4866 3190 0.0006 -
4.5007 3200 0.005 -
4.5148 3210 0.0027 -
4.5288 3220 0.0019 -
4.5429 3230 0.003 -
4.5570 3240 0.0024 -
4.5710 3250 0.0167 -
4.5851 3260 0.001 -
4.5992 3270 0.0022 -
4.6132 3280 0.013 -
4.6273 3290 0.0095 -
4.6414 3300 0.0202 -
4.6554 3310 0.0147 -
4.6695 3320 0.0009 -
4.6835 3330 0.0008 -
4.6976 3340 0.009 -
4.7117 3350 0.0018 -
4.7257 3360 0.0043 -
4.7398 3370 0.0014 -
4.7539 3380 0.0015 -
4.7679 3390 0.0111 -
4.7820 3400 0.0028 -
4.7961 3410 0.0019 -
4.8101 3420 0.0005 -
4.8242 3430 0.0102 -
4.8383 3440 0.0015 -
4.8523 3450 0.0014 -
4.8664 3460 0.0007 -
4.8805 3470 0.0006 -
4.8945 3480 0.0022 -
4.9086 3490 0.0034 -
4.9226 3500 0.0005 -
4.9367 3510 0.0055 -
4.9508 3520 0.0013 -
4.9648 3530 0.003 -
4.9789 3540 0.0105 -
4.9930 3550 0.0007 -

Framework Versions

  • Python: 3.11.0rc1
  • SetFit: 1.0.3
  • Sentence Transformers: 2.3.1
  • Transformers: 4.40.2
  • PyTorch: 2.1.2+cu121
  • Datasets: 2.16.1
  • Tokenizers: 0.19.1

Citation

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}
}
Downloads last month
11
Safetensors
Model size
22.7M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Wispra-fr/setfit-url-classifier

Finetuned
(18)
this model