SetFit with sentence-transformers/all-minilm-l6-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/all-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
negative
  • 'The decision to lower interest rates suggests that South Korea is attempting to stimulate economic activity. Lower interest rates usually make borrowing cheaper, encouraging businesses to invest and consumers to spend more. However, if consumers are already burdened with debt, they may be hesitant to take on more loans, negating some benefits of the rate cut. \n\nMeanwhile, there is a possibility that lowering rates too much could lead to inflation, as more money circulates in the economy. Alternatively, if the move is not met with increased spending, the central bank could find itself in a situation where it has to further reduce rates or implement unconventional monetary policies. \n\nIt’s'
  • "The urgency in the announcement suggests that this is a unique opportunity for investors. Investors who act quickly may benefit from purchasing shares at a favorable rate. However, one must consider that Google’s market valuation is likely already high, which could deter some potential bidders. The notion that Google may soon close the bidding process adds an element of scarcity, compelling investors to hurry. Yet, rushing into an investment without thorough research could lead to poor financial decisions. It is also possible that some investors might believe lucky charms or superstitions could influence the stock market's unpredictability. The competitive landscape in technology could also imply that other companies may soon surpass Google,"
  • 'The most appropriate initial imaging test for a 28-year-old woman with a breast lump is an ultrasound. Given her age and the characteristics of the lump, an ultrasound is preferred because it effectively evaluates breast lumps in younger women who typically have denser breast tissue, where mammograms might not be as informative. Additionally, an ultrasound can help distinguish between solid masses, like fibroadenomas, and cystic lesions.'
positive
  • 'POLICY HISTORY7/1992: Approved by Medical Policy Advisory Committee (MPAC)\n12/30/1999: Policy Guidelines updated\n9/21/2001:Policy rewritten to be reflective of Blue Cross Blue Shield Association policy # 7.01.05, Code Reference section updated, CPT code 92507, 92510 added\n11/2001: Reviewed by MPAC; revisions approved\n4/18/2002: Type of Service and Place of Service deleted\n5/29/2002: Code Reference section updated, CPT code 69949 added, HCPCS L8619, V5269, V5273, V5299, V5336, V5362, V5363 added\n3/6/2003: Code Reference section updated, CPT code 92601, 92602, 92603, 92604 added\n7/15/2004: Reviewed by MPAC, bilateral cochlear implantation considered investigational, Description section aligned with BCBSA policy # 7.01.05, definition of investigational added Policy Guidelines, Sources updated\n10/5/2004: Code Reference section updated, CPT code 69949 deleted, CPT 92507 description revised, CPT 92508 added, ICD-9 procedure code 20.96, 20.97, 20.99, 95.49 added, ICD-9 diagnosis code range 389.10-389.18 listed separately, ICD-9 diagnosis 389.7 added, HCPCS L8619 note added, HCPCS V5269, V5273, V5299, V5336, V5362, V5363 deleted\n3/22/2005: Code Reference section updated, CPT code 92510 description revised, HCPCS L8615, L8616, L8617, L8618 with Note: "See POLICY GUIDELINES for information regarding replacement of the external component of the cochlear implant" and effective date of 1/1/2005 added. 11/15/2005: HCPCS codes K0731, K0732, L8620 added\n03/10/2006: Coding updated. CPT4 / HCPCS 2006 revisions added to policy\n03/13/2006: Policy reviewed, no changes\n09/13/2006: Coding updated. ICD9 2006 revisions added to policy\n12/27/2006: Code Reference section updated per the 2007 HCPCS revisions\n3/27/2007: Policy reviewed, no changes to policy statement. Bilateral cochlear implantation added to Policy Guidelines section\n06/26/2007: Policy statement updated; bilateral cochlear implantation changed from investigational to may be considered medically necessary\n7/19/2007: Reviewed and approved by MPAC\n9/18/2007: Code reference section updated.'
  • '11/28/2012: Policy reviewed; no changes. 03/10/2014: Policy reviewed; no changes to policy statement. Removed deleted HCPCS codes J0560, J0570, and J0580 from the Code Reference section. Added HCPCS code J0561. 02/18/2015: Policy description updated regarding polymerase chain reaction and the evaluation of the Chemoattractant CXCL13.'
  • 'In order for equipment, devices, drugs or supplies [i.e, technologies], to be considered not investigative, the technology must have final approval from the appropriate governmental bodies, and scientific evidence must permit conclusions concerning the effect of the technology on health outcomes, and the technology must improve the net health outcome, and the technology must be as beneficial as any established alternative and the improvement must be attainable outside the testing/investigational setting. The coverage guidelines outlined in the Medical Policy Manual should not be used in lieu of the Member's specific benefit plan language. POLICY HISTORY7/1992: Approved by Medical Policy Advisory Committee (MPAC)\n12/30/1999: Policy Guidelines updated\n9/21/2001:Policy rewritten to be reflective of Blue Cross Blue Shield Association policy # 7.01.05, Code Reference section updated, CPT code 92507, 92510 added\n11/2001: Reviewed by MPAC; revisions approved\n4/18/2002: Type of Service and Place of Service deleted\n5/29/2002: Code Reference section updated, CPT code 69949 added, HCPCS L8619, V5269, V5273, V5299, V5336, V5362, V5363 added\n3/6/2003: Code Reference section updated, CPT code 92601, 92602, 92603, 92604 added\n7/15/2004: Reviewed by MPAC, bilateral cochlear implantation considered investigational, Description section aligned with BCBSA policy # 7.01.05, definition of investigational added Policy Guidelines, Sources updated\n10/5/2004: Code Reference section updated, CPT code 69949 deleted, CPT 92507 description revised, CPT 92508 added, ICD-9 procedure code 20.96, 20.97, 20.99, 95.49 added, ICD-9 diagnosis code range 389.10-389.18 listed separately, ICD-9 diagnosis 389.7 added, HCPCS L8619 note added, HCPCS V5269, V5273, V5299, V5336, V5362, V5363 deleted\n3/22/2005: Code Reference section updated, CPT code 92510 description revised, HCPCS L8615, L8616, L8617, L8618 with Note: "See POLICY GUIDELINES for information regarding replacement of the external component of the cochlear implant" and effective date of 1/1/2005 added. 11/15/2005: HCPCS codes K0731, K0732, L8620 added\n03/10/2006: Coding updated. CPT4 / HCPCS 2006 revisions added to policy\n03/13/2006: Policy reviewed, no changes\n09/13/2006: Coding updated.'

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("ashercn97/code-y-v2")
# Run inference
preds = model("03/10/2014: Policy reviewed; no changes to policy statement. Removed deleted HCPCS codes J0560, J0570, and J0580 from the Code Reference section. Added HCPCS code J0561. 02/18/2015: Policy description updated regarding polymerase chain reaction and the evaluation of the Chemoattractant CXCL13. Medically necessary policy statement regarding PCR-based direct detection of B. burgdorferi in CSF samples updated to add \"and may replace serologic documentation of infection\" to the policy statement.")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 45 143.875 298
Label Training Sample Count
negative 8
positive 8

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (4, 4)
  • max_steps: -1
  • sampling_strategy: oversampling
  • body_learning_rate: (2e-05, 1e-05)
  • head_learning_rate: 0.01
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.1
  • l2_weight: 0.01
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: True

Training Results

Epoch Step Training Loss Validation Loss
0.1111 1 0.3269 -
1.0 9 - 0.2071
2.0 18 - 0.1190
3.0 27 - 0.0741
4.0 36 - 0.0629

Framework Versions

  • Python: 3.11.10
  • SetFit: 1.1.2
  • Sentence Transformers: 4.0.2
  • Transformers: 4.51.3
  • PyTorch: 2.4.1+cu124
  • Datasets: 3.5.0
  • Tokenizers: 0.21.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
117
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