--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: "The ruling allows for the introduction of the accuser's sexual history as\ \ a way to challenge credibility. This aspect of the law is often controversial\ \ and can revive debates about victim-blaming. Many believe that a woman's sexual\ \ history should not be used to undermine her testimony. However, some legal experts\ \ argue that this type of evidence is sometimes necessary for a fair trial. \n\ \nOn the other hand, critics of this ruling may assert that it perpetuates a culture\ \ of disbelief towards victims of sexual assault. They could argue that such evidence\ \ could deter future victims from coming forward, fearing their private lives\ \ may be exposed. Furthermore, the defense might leverage this" - text: '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.' - text: 'In the case of a 17-year-old male with a stabbing injury, the physician has an obligation to prioritize the patient''s immediate medical care and ensure his safety. Once stabilized, the issue of confidentiality and reporting must be carefully considered. In this scenario, the law typically mandates that medical professionals report injuries resulting from violent acts, such as stabbing, to law enforcement. This requirement is in place to help protect the patient and address potential broader safety concerns. Despite the patient''s fear of gang retaliation, the physician must comply with legal obligations to report the injury. It is crucial for the physician to have an open and empathetic conversation with the patient. The physician should explain the legal requirements for reporting such injuries, the rationale behind these laws, and the steps involved in the process. Additionally, the physician can discuss the resources and support available to the patient, such as counseling or protective services, to address his concerns about safety and retaliation. While this situation is challenging due to the patient''s fear, balancing ethical obligations to the patient with legal responsibilities is essential. By reporting the injury, the physician fulfills their legal duty while seeking to ensure both the patient''s and the community''s safety.' - text: '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) 12/30/1999: Policy Guidelines updated 9/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 11/2001: Reviewed by MPAC; revisions approved 4/18/2002: Type of Service and Place of Service deleted 5/29/2002: Code Reference section updated, CPT code 69949 added, HCPCS L8619, V5269, V5273, V5299, V5336, V5362, V5363 added 3/6/2003: Code Reference section updated, CPT code 92601, 92602, 92603, 92604 added 7/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 10/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 3/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 03/10/2006: Coding updated. CPT4 / HCPCS 2006 revisions added to policy 03/13/2006: Policy reviewed, no changes 09/13/2006: Coding updated. ICD9 2006 revisions added to policy 12/27/2006: Code Reference section updated per the 2007 HCPCS revisions 3/27/2007: Policy reviewed, no changes to policy statement.' - text: 'POLICY HISTORY1/1994: Approved by Medical Policy Advisory Committee (MPAC) 5/1/2002: Type of Service and Place of Service deleted 3/25/2004: Reviewed by MPAC, Policy title “Lyme Disease Treatment” renamed “Intravenous Antiobiotic Therapy for Lyme Disease”, Description and Policy sections revised to be consistent with BCBSA policy # 5.01.08, intravenous antibiotic therapy changed from investigational to medically necessary for certain indications, investigation definition added, Sources updated, tables added to Code Reference section 5/5/2004: Code Reference section completed 3/13/2006: Policy reviewed, no changes 9/12/2006: Coding reviewed. ICD9 2006 revisions added to policy 11/13/2006: Code Reference section updated: CPT codes 87475, 87476, and 87477 deleted from policy 4/24/2007: Policy reviewed, policy statement rewritten for clarification 6/21/2007: Policy reviewed, description updated. Policy statement revised; IV antibiotic therapy is not medically necessary for uncomplicated cranial nerve palsy associated with Lyme disease and antibiotic-refractory Lyme arthritis 7/19/2007: Reviewed and approved by MPAC 7/10/2009: Policy reviewed, no changes 12/15/2009: Coding Section revised with 2010 CPT4 and HCPCS revisions 02/23/2011: Added the following to the policy statement: Determination of levels of the B lymphocyte chemoattractant CXCL13 for diagnosis or monitoring treatment is considered investigational. No changes to other policy statements. Removed deleted HCPCS codes J0530, J0540, and J0550 from the Code Reference section.' metrics: - accuracy pipeline_tag: text-classification library_name: setfit inference: true base_model: sentence-transformers/all-minilm-l6-v2 --- # SetFit with sentence-transformers/all-minilm-l6-v2 This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/all-minilm-l6-v2](https://huggingface.co/sentence-transformers/all-minilm-l6-v2) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) 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](https://www.sbert.net) with contrastive learning. 2. Training a classification head with features from the fine-tuned Sentence Transformer. ## Model Details ### Model Description - **Model Type:** SetFit - **Sentence Transformer body:** [sentence-transformers/all-minilm-l6-v2](https://huggingface.co/sentence-transformers/all-minilm-l6-v2) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 256 tokens - **Number of Classes:** 2 classes ### Model Sources - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit) - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055) - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit) ### Model Labels | Label | Examples | |:---------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | negative | | | positive | | ## 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("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 ```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} } ```