Add SetFit model
Browse files- 1_Pooling/config.json +10 -0
- README.md +293 -0
- config.json +25 -0
- config_sentence_transformers.json +10 -0
- config_setfit.json +7 -0
- model.safetensors +3 -0
- model_head.pkl +3 -0
- modules.json +20 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +65 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 384,
|
3 |
+
"pooling_mode_cls_token": false,
|
4 |
+
"pooling_mode_mean_tokens": true,
|
5 |
+
"pooling_mode_max_tokens": false,
|
6 |
+
"pooling_mode_mean_sqrt_len_tokens": false,
|
7 |
+
"pooling_mode_weightedmean_tokens": false,
|
8 |
+
"pooling_mode_lasttoken": false,
|
9 |
+
"include_prompt": true
|
10 |
+
}
|
README.md
ADDED
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- setfit
|
4 |
+
- sentence-transformers
|
5 |
+
- text-classification
|
6 |
+
- generated_from_setfit_trainer
|
7 |
+
widget:
|
8 |
+
- text: "The ruling allows for the introduction of the accuser's sexual history as\
|
9 |
+
\ a way to challenge credibility. This aspect of the law is often controversial\
|
10 |
+
\ and can revive debates about victim-blaming. Many believe that a woman's sexual\
|
11 |
+
\ history should not be used to undermine her testimony. However, some legal experts\
|
12 |
+
\ argue that this type of evidence is sometimes necessary for a fair trial. \n\
|
13 |
+
\nOn the other hand, critics of this ruling may assert that it perpetuates a culture\
|
14 |
+
\ of disbelief towards victims of sexual assault. They could argue that such evidence\
|
15 |
+
\ could deter future victims from coming forward, fearing their private lives\
|
16 |
+
\ may be exposed. Furthermore, the defense might leverage this"
|
17 |
+
- text: '03/10/2014: Policy reviewed; no changes to policy statement. Removed deleted
|
18 |
+
HCPCS codes J0560, J0570, and J0580 from the Code Reference section. Added HCPCS
|
19 |
+
code J0561. 02/18/2015: Policy description updated regarding polymerase chain
|
20 |
+
reaction and the evaluation of the Chemoattractant CXCL13. Medically necessary
|
21 |
+
policy statement regarding PCR-based direct detection of B. burgdorferi in CSF
|
22 |
+
samples updated to add "and may replace serologic documentation of infection"
|
23 |
+
to the policy statement.'
|
24 |
+
- text: 'In the case of a 17-year-old male with a stabbing injury, the physician has
|
25 |
+
an obligation to prioritize the patient''s immediate medical care and ensure his
|
26 |
+
safety. Once stabilized, the issue of confidentiality and reporting must be carefully
|
27 |
+
considered.
|
28 |
+
|
29 |
+
|
30 |
+
In this scenario, the law typically mandates that medical professionals report
|
31 |
+
injuries resulting from violent acts, such as stabbing, to law enforcement. This
|
32 |
+
requirement is in place to help protect the patient and address potential broader
|
33 |
+
safety concerns. Despite the patient''s fear of gang retaliation, the physician
|
34 |
+
must comply with legal obligations to report the injury.
|
35 |
+
|
36 |
+
|
37 |
+
It is crucial for the physician to have an open and empathetic conversation with
|
38 |
+
the patient. The physician should explain the legal requirements for reporting
|
39 |
+
such injuries, the rationale behind these laws, and the steps involved in the
|
40 |
+
process. Additionally, the physician can discuss the resources and support available
|
41 |
+
to the patient, such as counseling or protective services, to address his concerns
|
42 |
+
about safety and retaliation.
|
43 |
+
|
44 |
+
|
45 |
+
While this situation is challenging due to the patient''s fear, balancing ethical
|
46 |
+
obligations to the patient with legal responsibilities is essential. By reporting
|
47 |
+
the injury, the physician fulfills their legal duty while seeking to ensure both
|
48 |
+
the patient''s and the community''s safety.'
|
49 |
+
- text: 'The coverage guidelines outlined in the Medical Policy Manual should not
|
50 |
+
be used in lieu of the Member''s specific benefit plan language. POLICY HISTORY7/1992:
|
51 |
+
Approved by Medical Policy Advisory Committee (MPAC)
|
52 |
+
|
53 |
+
12/30/1999: Policy Guidelines updated
|
54 |
+
|
55 |
+
9/21/2001:Policy rewritten to be reflective of Blue Cross Blue Shield Association
|
56 |
+
policy # 7.01.05, Code Reference section updated, CPT code 92507, 92510 added
|
57 |
+
|
58 |
+
11/2001: Reviewed by MPAC; revisions approved
|
59 |
+
|
60 |
+
4/18/2002: Type of Service and Place of Service deleted
|
61 |
+
|
62 |
+
5/29/2002: Code Reference section updated, CPT code 69949 added, HCPCS L8619,
|
63 |
+
V5269, V5273, V5299, V5336, V5362, V5363 added
|
64 |
+
|
65 |
+
3/6/2003: Code Reference section updated, CPT code 92601, 92602, 92603, 92604
|
66 |
+
added
|
67 |
+
|
68 |
+
7/15/2004: Reviewed by MPAC, bilateral cochlear implantation considered investigational,
|
69 |
+
Description section aligned with BCBSA policy # 7.01.05, definition of investigational
|
70 |
+
added Policy Guidelines, Sources updated
|
71 |
+
|
72 |
+
10/5/2004: Code Reference section updated, CPT code 69949 deleted, CPT 92507 description
|
73 |
+
revised, CPT 92508 added, ICD-9 procedure code 20.96, 20.97, 20.99, 95.49 added,
|
74 |
+
ICD-9 diagnosis code range 389.10-389.18 listed separately, ICD-9 diagnosis 389.7
|
75 |
+
added, HCPCS L8619 note added, HCPCS V5269, V5273, V5299, V5336, V5362, V5363
|
76 |
+
deleted
|
77 |
+
|
78 |
+
3/22/2005: Code Reference section updated, CPT code 92510 description revised,
|
79 |
+
HCPCS L8615, L8616, L8617, L8618 with Note: "See POLICY GUIDELINES for information
|
80 |
+
regarding replacement of the external component of the cochlear implant" and effective
|
81 |
+
date of 1/1/2005 added. 11/15/2005: HCPCS codes K0731, K0732, L8620 added
|
82 |
+
|
83 |
+
03/10/2006: Coding updated. CPT4 / HCPCS 2006 revisions added to policy
|
84 |
+
|
85 |
+
03/13/2006: Policy reviewed, no changes
|
86 |
+
|
87 |
+
09/13/2006: Coding updated. ICD9 2006 revisions added to policy
|
88 |
+
|
89 |
+
12/27/2006: Code Reference section updated per the 2007 HCPCS revisions
|
90 |
+
|
91 |
+
3/27/2007: Policy reviewed, no changes to policy statement.'
|
92 |
+
- text: 'POLICY HISTORY1/1994: Approved by Medical Policy Advisory Committee (MPAC)
|
93 |
+
|
94 |
+
5/1/2002: Type of Service and Place of Service deleted
|
95 |
+
|
96 |
+
3/25/2004: Reviewed by MPAC, Policy title “Lyme Disease Treatment” renamed “Intravenous
|
97 |
+
Antiobiotic Therapy for Lyme Disease”, Description and Policy sections revised
|
98 |
+
to be consistent with BCBSA policy # 5.01.08, intravenous antibiotic therapy changed
|
99 |
+
from investigational to medically necessary for certain indications, investigation
|
100 |
+
definition added, Sources updated, tables added to Code Reference section
|
101 |
+
|
102 |
+
5/5/2004: Code Reference section completed
|
103 |
+
|
104 |
+
3/13/2006: Policy reviewed, no changes
|
105 |
+
|
106 |
+
9/12/2006: Coding reviewed. ICD9 2006 revisions added to policy
|
107 |
+
|
108 |
+
11/13/2006: Code Reference section updated: CPT codes 87475, 87476, and 87477
|
109 |
+
deleted from policy
|
110 |
+
|
111 |
+
4/24/2007: Policy reviewed, policy statement rewritten for clarification
|
112 |
+
|
113 |
+
6/21/2007: Policy reviewed, description updated. Policy statement revised; IV
|
114 |
+
antibiotic therapy is not medically necessary for uncomplicated cranial nerve
|
115 |
+
palsy associated with Lyme disease and antibiotic-refractory Lyme arthritis
|
116 |
+
|
117 |
+
7/19/2007: Reviewed and approved by MPAC
|
118 |
+
|
119 |
+
7/10/2009: Policy reviewed, no changes
|
120 |
+
|
121 |
+
12/15/2009: Coding Section revised with 2010 CPT4 and HCPCS revisions
|
122 |
+
|
123 |
+
02/23/2011: Added the following to the policy statement: Determination of levels
|
124 |
+
of the B lymphocyte chemoattractant CXCL13 for diagnosis or monitoring treatment
|
125 |
+
is considered investigational. No changes to other policy statements. Removed
|
126 |
+
deleted HCPCS codes J0530, J0540, and J0550 from the Code Reference section.'
|
127 |
+
metrics:
|
128 |
+
- accuracy
|
129 |
+
pipeline_tag: text-classification
|
130 |
+
library_name: setfit
|
131 |
+
inference: true
|
132 |
+
base_model: sentence-transformers/all-minilm-l6-v2
|
133 |
+
---
|
134 |
+
|
135 |
+
# SetFit with sentence-transformers/all-minilm-l6-v2
|
136 |
+
|
137 |
+
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.
|
138 |
+
|
139 |
+
The model has been trained using an efficient few-shot learning technique that involves:
|
140 |
+
|
141 |
+
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
|
142 |
+
2. Training a classification head with features from the fine-tuned Sentence Transformer.
|
143 |
+
|
144 |
+
## Model Details
|
145 |
+
|
146 |
+
### Model Description
|
147 |
+
- **Model Type:** SetFit
|
148 |
+
- **Sentence Transformer body:** [sentence-transformers/all-minilm-l6-v2](https://huggingface.co/sentence-transformers/all-minilm-l6-v2)
|
149 |
+
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
150 |
+
- **Maximum Sequence Length:** 256 tokens
|
151 |
+
- **Number of Classes:** 2 classes
|
152 |
+
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
153 |
+
<!-- - **Language:** Unknown -->
|
154 |
+
<!-- - **License:** Unknown -->
|
155 |
+
|
156 |
+
### Model Sources
|
157 |
+
|
158 |
+
- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
|
159 |
+
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
160 |
+
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
161 |
+
|
162 |
+
### Model Labels
|
163 |
+
| Label | Examples |
|
164 |
+
|:---------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
165 |
+
| negative | <ul><li>'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'</li><li>"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,"</li><li>'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.'</li></ul> |
|
166 |
+
| positive | <ul><li>'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.'</li><li>'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.'</li><li>'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.'</li></ul> |
|
167 |
+
|
168 |
+
## Uses
|
169 |
+
|
170 |
+
### Direct Use for Inference
|
171 |
+
|
172 |
+
First install the SetFit library:
|
173 |
+
|
174 |
+
```bash
|
175 |
+
pip install setfit
|
176 |
+
```
|
177 |
+
|
178 |
+
Then you can load this model and run inference.
|
179 |
+
|
180 |
+
```python
|
181 |
+
from setfit import SetFitModel
|
182 |
+
|
183 |
+
# Download from the 🤗 Hub
|
184 |
+
model = SetFitModel.from_pretrained("ashercn97/code-y-v2")
|
185 |
+
# Run inference
|
186 |
+
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.")
|
187 |
+
```
|
188 |
+
|
189 |
+
<!--
|
190 |
+
### Downstream Use
|
191 |
+
|
192 |
+
*List how someone could finetune this model on their own dataset.*
|
193 |
+
-->
|
194 |
+
|
195 |
+
<!--
|
196 |
+
### Out-of-Scope Use
|
197 |
+
|
198 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
199 |
+
-->
|
200 |
+
|
201 |
+
<!--
|
202 |
+
## Bias, Risks and Limitations
|
203 |
+
|
204 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
205 |
+
-->
|
206 |
+
|
207 |
+
<!--
|
208 |
+
### Recommendations
|
209 |
+
|
210 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
211 |
+
-->
|
212 |
+
|
213 |
+
## Training Details
|
214 |
+
|
215 |
+
### Training Set Metrics
|
216 |
+
| Training set | Min | Median | Max |
|
217 |
+
|:-------------|:----|:--------|:----|
|
218 |
+
| Word count | 45 | 143.875 | 298 |
|
219 |
+
|
220 |
+
| Label | Training Sample Count |
|
221 |
+
|:---------|:----------------------|
|
222 |
+
| negative | 8 |
|
223 |
+
| positive | 8 |
|
224 |
+
|
225 |
+
### Training Hyperparameters
|
226 |
+
- batch_size: (16, 16)
|
227 |
+
- num_epochs: (4, 4)
|
228 |
+
- max_steps: -1
|
229 |
+
- sampling_strategy: oversampling
|
230 |
+
- body_learning_rate: (2e-05, 1e-05)
|
231 |
+
- head_learning_rate: 0.01
|
232 |
+
- loss: CosineSimilarityLoss
|
233 |
+
- distance_metric: cosine_distance
|
234 |
+
- margin: 0.25
|
235 |
+
- end_to_end: False
|
236 |
+
- use_amp: False
|
237 |
+
- warmup_proportion: 0.1
|
238 |
+
- l2_weight: 0.01
|
239 |
+
- seed: 42
|
240 |
+
- eval_max_steps: -1
|
241 |
+
- load_best_model_at_end: True
|
242 |
+
|
243 |
+
### Training Results
|
244 |
+
| Epoch | Step | Training Loss | Validation Loss |
|
245 |
+
|:------:|:----:|:-------------:|:---------------:|
|
246 |
+
| 0.1111 | 1 | 0.3269 | - |
|
247 |
+
| 1.0 | 9 | - | 0.2071 |
|
248 |
+
| 2.0 | 18 | - | 0.1190 |
|
249 |
+
| 3.0 | 27 | - | 0.0741 |
|
250 |
+
| 4.0 | 36 | - | 0.0629 |
|
251 |
+
|
252 |
+
### Framework Versions
|
253 |
+
- Python: 3.11.10
|
254 |
+
- SetFit: 1.1.2
|
255 |
+
- Sentence Transformers: 4.0.2
|
256 |
+
- Transformers: 4.51.3
|
257 |
+
- PyTorch: 2.4.1+cu124
|
258 |
+
- Datasets: 3.5.0
|
259 |
+
- Tokenizers: 0.21.1
|
260 |
+
|
261 |
+
## Citation
|
262 |
+
|
263 |
+
### BibTeX
|
264 |
+
```bibtex
|
265 |
+
@article{https://doi.org/10.48550/arxiv.2209.11055,
|
266 |
+
doi = {10.48550/ARXIV.2209.11055},
|
267 |
+
url = {https://arxiv.org/abs/2209.11055},
|
268 |
+
author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
|
269 |
+
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
|
270 |
+
title = {Efficient Few-Shot Learning Without Prompts},
|
271 |
+
publisher = {arXiv},
|
272 |
+
year = {2022},
|
273 |
+
copyright = {Creative Commons Attribution 4.0 International}
|
274 |
+
}
|
275 |
+
```
|
276 |
+
|
277 |
+
<!--
|
278 |
+
## Glossary
|
279 |
+
|
280 |
+
*Clearly define terms in order to be accessible across audiences.*
|
281 |
+
-->
|
282 |
+
|
283 |
+
<!--
|
284 |
+
## Model Card Authors
|
285 |
+
|
286 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
287 |
+
-->
|
288 |
+
|
289 |
+
<!--
|
290 |
+
## Model Card Contact
|
291 |
+
|
292 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
293 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertModel"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 384,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 1536,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 6,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"torch_dtype": "float32",
|
21 |
+
"transformers_version": "4.51.3",
|
22 |
+
"type_vocab_size": 2,
|
23 |
+
"use_cache": true,
|
24 |
+
"vocab_size": 30522
|
25 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "4.0.2",
|
4 |
+
"transformers": "4.51.3",
|
5 |
+
"pytorch": "2.4.1+cu124"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": "cosine"
|
10 |
+
}
|
config_setfit.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"normalize_embeddings": false,
|
3 |
+
"labels": [
|
4 |
+
"negative",
|
5 |
+
"positive"
|
6 |
+
]
|
7 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4b356b83b8701d5ac569dfe4ccea9b1aaea3c24e2ae370087438b48af25d3a1
|
3 |
+
size 90864192
|
model_head.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7b29f2032e1d64f28571de835185e824908b103e50c8acba6747bdfea109c13f
|
3 |
+
size 3983
|
modules.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"idx": 0,
|
4 |
+
"name": "0",
|
5 |
+
"path": "",
|
6 |
+
"type": "sentence_transformers.models.Transformer"
|
7 |
+
},
|
8 |
+
{
|
9 |
+
"idx": 1,
|
10 |
+
"name": "1",
|
11 |
+
"path": "1_Pooling",
|
12 |
+
"type": "sentence_transformers.models.Pooling"
|
13 |
+
},
|
14 |
+
{
|
15 |
+
"idx": 2,
|
16 |
+
"name": "2",
|
17 |
+
"path": "2_Normalize",
|
18 |
+
"type": "sentence_transformers.models.Normalize"
|
19 |
+
}
|
20 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 256,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": {
|
3 |
+
"content": "[CLS]",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"mask_token": {
|
10 |
+
"content": "[MASK]",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"sep_token": {
|
24 |
+
"content": "[SEP]",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"unk_token": {
|
31 |
+
"content": "[UNK]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
}
|
37 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": false,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": true,
|
48 |
+
"extra_special_tokens": {},
|
49 |
+
"mask_token": "[MASK]",
|
50 |
+
"max_length": 128,
|
51 |
+
"model_max_length": 256,
|
52 |
+
"never_split": null,
|
53 |
+
"pad_to_multiple_of": null,
|
54 |
+
"pad_token": "[PAD]",
|
55 |
+
"pad_token_type_id": 0,
|
56 |
+
"padding_side": "right",
|
57 |
+
"sep_token": "[SEP]",
|
58 |
+
"stride": 0,
|
59 |
+
"strip_accents": null,
|
60 |
+
"tokenize_chinese_chars": true,
|
61 |
+
"tokenizer_class": "BertTokenizer",
|
62 |
+
"truncation_side": "right",
|
63 |
+
"truncation_strategy": "longest_first",
|
64 |
+
"unk_token": "[UNK]"
|
65 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|