CoolFace
Modelpublic

ashercn97/code-y-v3

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes5downloads
README.md230 linesDownload Raw Back to root
1---2tags:3- setfit4- sentence-transformers5- text-classification6- generated_from_setfit_trainer7widget:8- text: '- Barth BM, Shanmugavelandy SS, Tacelosky DM, Kester M, Morad SA, Cabot MC9    (2013). "Gaucher''s disease and cancer: a sphingolipid perspective". Crit Rev10    Oncog 18 (3): 221–34. doi:10.1615/critrevoncog.2013005814. PMC 3604879.'11- text: '"The intersection of attention-deficit/hyperactivity disorder and substance12    abuse". Curr Opin Psychiatry. 24 (4): 280–285. doi:10.1097/YCO.0b013e328345c956.13    PMC .'14- text: 'Parrilla-Rodriguez AM, Gorrin-Peralta JJ. La Lactancia Materna en Puerto15    Rico: Patrones Tradicionales, Tendencias Nacionales y Estrategias para el Futuro.16    P R Health Sci J 1999;18:223-228. (42.) Ni H, Simile C, Hardy AM.'17- text: 'For cases where there is an actual exposure to someone who is confirmed to18    have COVID-19, report code Z20.828, Contact with and (suspected) exposure to other19    viral communicable diseases. This code is not necessary if the exposed patient20    is confirmed to have COVID-19. - Signs and symptoms: For patients presenting with21    any signs/symptoms and where a definitive diagnosis has not been established,22    assign the appropriate code(s) for each of the presenting signs and symptoms such23    as: Cough (R05); Shortness of breath (R06.02) or Fever unspecified (R50.9). Do24    not report “suspected” cases of COVID-19 with B97.29. In addition, diagnosis code25    B34.2, Coronavirus infection, unspecified, typically is not appropriate.'26- text: '- HCPCS codes: what the provider used. - ICD-10-CM: why the provider ''did''27    and ''used''. For example, if a urologist diagnoses a patient with bladder cancer28    and performs a bladder instillation of 1 mg of Bacillus Calmette-Guerin (BCG)29    to treat the tumor, the medical coder might assign:30 31    - CPT® codes (did): 51720 (Bladder instillation of anticarcinogenic agent (including32    retention time))33 34    - HCPCS code (used): J9030 (BCG live intravesical instillation, 1mg)35 36    - ICD-10 code (why): C67.9 (Malignant neoplasm of bladder, unspecified)37 38    As mentioned above, though, there are some exceptions to these general code set39    concepts. WHEN TO CHOOSE CPT® Vs HCPCS40 41    First, not all payers accept HCPCS Level II codes. Initially intended for Medicare42    claims, many private payers have since adopted the HCPCS Level II code set.'43metrics:44- accuracy45pipeline_tag: text-classification46library_name: setfit47inference: true48base_model: sentence-transformers/paraphrase-mpnet-base-v249model-index:50- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v251  results:52  - task:53      type: text-classification54      name: Text Classification55    dataset:56      name: Unknown57      type: unknown58      split: test59    metrics:60    - type: accuracy61      value: 0.857142857142857162      name: Accuracy63---64 65# SetFit with sentence-transformers/paraphrase-mpnet-base-v266 67This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-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.68 69The model has been trained using an efficient few-shot learning technique that involves:70 711. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.722. Training a classification head with features from the fine-tuned Sentence Transformer.73 74## Model Details75 76### Model Description77- **Model Type:** SetFit78- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)79- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance80- **Maximum Sequence Length:** 512 tokens81- **Number of Classes:** 2 classes82<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->83<!-- - **Language:** Unknown -->84<!-- - **License:** Unknown -->85 86### Model Sources87 88- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)89- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)90- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)91 92### Model Labels93| Label    | Examples                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |94|:---------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|95| negative | <ul><li>'Estimates of mortality attributable to TB\nVital registration systems were considered to be good in 81 countries with a total population of 2.7 billion (Table 4). Most of the population of the WHO European and South-East Asia Regions and the Region of the Americas was covered by good vital registration systems. However, this proportion was low (< 20%) in the African, Eastern Mediterranean and Western Pacific Regions (Table 4). Of the 22 countries with a high burden of TB, only three (India, Philippines and the Russian Federation) with a total population of 1.3 billion were considered to have good vital registration systems. Seventy-seven of the 81 countries with a good vital registration system reported data on mortality statistics using ICD-9 or ICD-10 to WHO.'</li><li>'2000. Aggressive behavior, increased accumbal dopamine, and decreased cortical serotonin in rats. Journal of Neuroscience, 20(24): 9320-9325. Van Gastel A, Schotte C, Maes M. 1997. The prediction of suicidal intent in depressed patients.'</li><li>'Conventional childhood and adult cardiovascular risk factors did not explain the association between place of birth and AF-related mortality. Lifecourse cardiovascular epidemiology has demonstrated that early life risk factors such as low birthweight and childhood socioeconomic adversity predict greater risk for angina and atherosclerosis as well as adult mortality from coronary heart disease and stroke. (Galobardes et al., 2006, Fabsitz and Feinleib, 1980, Batty et al., 2007, Glymour et al., 2007) Atrial fibrillation (AF) is the most common cardiac arrhythmia, (Benjamin et al., 2009, Magnani et al., 2011) and is responsible for significant morbidity from heart failure, dementia, and stroke, and increased mortality. Few articles have addressed whether early life conditions contribute to the development of AF. Preliminary evidence suggests that early life factors may influence AF, but via mechanisms distinct from those established for most other cardiovascular outcomes.'</li></ul>                                                                            |96| positive | <ul><li>'As a result, these are not reimbursed at the usual rate, sometimes these are not paid at all. The provider has to have in-depth knowledge regarding the assignment of the correct primary and secondary diagnostic codes to ensure full reimbursement. • Reporting all professional services in all settings such as inpatient, outpatient, home and nursing facilities, correctly using the appropriate CPT five digit codes\n• Appropriate use of evaluation and management (E/M) codes or the five digit codes used to report non-procedural professional services. These codes should clearly highlight the complexity of the service provided. Tests such as gait and balance assessment, mini mental status exam, history, physical and family interview do not have their own CPT codes.'</li><li>'Possible locations of an aortic aneurysm are as follows:\n• Ascending (441.2); if ruptured, use 441.1;\n• Arch (441.2); if ruptured, use 441.1;\n• Descending, not otherwise specified (NOS) (441.9); if ruptured, use 441.5;\n• Thoracic descending (441.2); if ruptured, use 441.1;\n• Abdominal descending (441.4); if ruptured, use 441.3;\n• Thoracoabdominal (441.7); if ruptured, use 441.6;\n• Abdominal (441.4); if ruptured, use 441.3. An abdominal aortic aneurysm is the most common type. If an aortic aneurysm is documented but not specified as to site, assign code 441.9. A ruptured aortic aneurysm, NOS is classified to code 441.5. A pseudoaneurysm (false aneurysm) is an aneurysm that does not have some or all of the aortic wall layers.'</li><li>'International Classification of Diseases, Clinical Modification (ICD-9-CM) is an adaption created by the U.S. National Center for Health Statistics (NCHS) and used in assigning diagnostic and procedure codes associated with inpatient, outpatient, and physician office utilization in the United States. The ICD-9-CM is based on the ICD-9 but provides for additional morbidity detail. It is updated annually on October 1. It consists of two or three volumes:\n- Volumes 1 and 2 contain diagnosis codes. (Volume 1 is a tabular listing, and volume 2 is an index.)'</li></ul> |97 98## Evaluation99 100### Metrics101| Label   | Accuracy |102|:--------|:---------|103| **all** | 0.8571   |104 105## Uses106 107### Direct Use for Inference108 109First install the SetFit library:110 111```bash112pip install setfit113```114 115Then you can load this model and run inference.116 117```python118from setfit import SetFitModel119 120# Download from the 🤗 Hub121model = SetFitModel.from_pretrained("ashercn97/code-y-v3")122# Run inference123preds = model("\"The intersection of attention-deficit/hyperactivity disorder and substance abuse\". Curr Opin Psychiatry. 24 (4): 280–285. doi:10.1097/YCO.0b013e328345c956. PMC .")124```125 126<!--127### Downstream Use128 129*List how someone could finetune this model on their own dataset.*130-->131 132<!--133### Out-of-Scope Use134 135*List how the model may foreseeably be misused and address what users ought not to do with the model.*136-->137 138<!--139## Bias, Risks and Limitations140 141*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*142-->143 144<!--145### Recommendations146 147*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*148-->149 150## Training Details151 152### Training Set Metrics153| Training set | Min | Median   | Max |154|:-------------|:----|:---------|:----|155| Word count   | 21  | 101.3125 | 172 |156 157| Label    | Training Sample Count |158|:---------|:----------------------|159| negative | 8                     |160| positive | 8                     |161 162### Training Hyperparameters163- batch_size: (16, 16)164- num_epochs: (4, 4)165- max_steps: -1166- sampling_strategy: oversampling167- body_learning_rate: (2e-05, 1e-05)168- head_learning_rate: 0.01169- loss: CosineSimilarityLoss170- distance_metric: cosine_distance171- margin: 0.25172- end_to_end: False173- use_amp: False174- warmup_proportion: 0.1175- l2_weight: 0.01176- seed: 42177- eval_max_steps: -1178- load_best_model_at_end: True179 180### Training Results181| Epoch  | Step | Training Loss | Validation Loss |182|:------:|:----:|:-------------:|:---------------:|183| 0.1111 | 1    | 0.4011        | -               |184| 1.0    | 9    | -             | 0.1458          |185| 2.0    | 18   | -             | 0.0775          |186| 3.0    | 27   | -             | 0.0748          |187| 4.0    | 36   | -             | 0.0664          |188 189### Framework Versions190- Python: 3.10.12191- SetFit: 1.1.2192- Sentence Transformers: 4.0.2193- Transformers: 4.51.3194- PyTorch: 2.6.0195- Datasets: 3.5.0196- Tokenizers: 0.21.1197 198## Citation199 200### BibTeX201```bibtex202@article{https://doi.org/10.48550/arxiv.2209.11055,203    doi = {10.48550/ARXIV.2209.11055},204    url = {https://arxiv.org/abs/2209.11055},205    author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},206    keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},207    title = {Efficient Few-Shot Learning Without Prompts},208    publisher = {arXiv},209    year = {2022},210    copyright = {Creative Commons Attribution 4.0 International}211}212```213 214<!--215## Glossary216 217*Clearly define terms in order to be accessible across audiences.*218-->219 220<!--221## Model Card Authors222 223*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*224-->225 226<!--227## Model Card Contact228 229*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*230-->