--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 metrics: - accuracy widget: - text: '"Relato. PACIENTE REFIERE PRESENTAR DOLOR EN CODO DERECHO DESDE FINES DE DICIEMBRE DEL 2022. SIN SINTOMAS PREVIOS, SIN ANT TRAUMATICOS. REFIERE EN SU TRABAJO DEBE REALIZAR ASEO, PLANTACION Y PODA, TODO SE REALIZA DE FORMA MANUAL Y OCUPA ALGUNAS HERRAMIENTAS COMO TIJERAS, PALAS, TALADROS, ENTRE OTRAS. Agente. MOVIMIENTOS REPETITIVOS"' - text: '"Relato. En esa bodega hay aceites de motor ( más de 15 tambores) y están los recipientes para reciclarlos. Con el calor que está haciendo acá el aceite se evapora, y desde hace 3 a 4 meses tengo sangramiento de la nariz ( de los 2 lados), incluso en la noche. La bodega es un container de puro fierro. A veces me baja moquillo clarito con pedacitos de sangre. A veces presento moretones chicos en los brazos. Nota : a veces con gingivorragia, sin otros sangramientos aparentes. regla de 5 días. Horario : de lun a vier 8.30-13.30. 15.15-17.15 hrs. Domingopor medio trabaja como garzona en un resataurante Agente. ingresando facturas"' - text: '"Relato. paciente refiere que inicia síntomas a mediados de octubre, con aversión al puesto de trabajo, además irritabilidad presente con el jefe; además alteración en ciclo sueño vigilia, sin problemas de conciliación, con despertar intermiten por pesadillas que tiene de accidentes del bus,. Agrega molestias en los hombros y en la espalda: Agregan además aparece titiriton de parpadeo derecho. Agrega ademas miedo a la muerte; con agorafobia. Nunca me había sentido así ; en la pregunta dirigida; reducido, sin baja de peso. Labilidad; a veces. Agente. varios temas "' - text: '"Relato. ME DUELE EL TOBILLO IZQUIERDO, 2 MESES DE EVOLUCION. Agente. MOVIMIENTO REPETITIVO"' - text: '"Relato. SINTOMAS DESDE JULIO. ME DUELE EL PECHO, ME PONGO A TIRITAR, CUANDO VOY EN EL AUTO ME HAGO ASI (GOLPEA EL PECHO) PARA QUE SE ME QUITE. REFIERE ANGUSTIA, NO TENER GANAS DE IR A TRABAJAR, ESO. NO REFIERE OTROS SINTOMAS. SEÑALA QUE FUE AL PSIQUIATRA PORQUE NO QUERIA ESTAR LA ULTIMA SEMANA CON EL EQUIPO DE GESTION, COMPUESTO POR INSPECTORA GENERAL, OTRO INSPECTOR, RR.HH, DOS UTP Y EL DIRECTOR. PERSISTE SINTOMATICA PESE A INICIAR TTO CON SERTRALINA (SOLO LLEVA 3 DIAS) Y ESTAR CON REPOSO MEDICO. Agente. MALTRATO POR INSPECTORA"' pipeline_tag: text-classification inference: true --- # SetFit with sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co./sentence-transformers/paraphrase-multilingual-MiniLM-L12-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/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co./sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 128 tokens - **Number of Classes:** 19 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 | |:---------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Esfuerzo vocal | | | Otros trabajos repetitivos | | | Otros agentes causales | | | caucho, látex natural | | | Otros agentes químicos | | | Otros tipos de esfuerzo | | | Trabajo repetitivo con movimientos asimétricos | | | Trabajar en ambiente ruidoso | | | Transporte de carga al caminar | | | Otro tipo de movimiento | | | Otros tipos de transporte y levantamiento de cargas | | | Empujar o tirar con una parte del cuerpo con movimientos repetitivos | | | Caminar durante largo tiempo | | | Problemas interpersonales en relación con los superiores | | | Demanda excesiva de trabajo | | | Hostilidad de la jefatura | | | Problemas interpersonales en relación con los otros empleados | | | Acoso sexual | | | Ausencia de apoyo social de la empresa | | ## 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("lmaccarini/setfit-ep-v1") # Run inference preds = model("\"Relato. ME DUELE EL TOBILLO IZQUIERDO, 2 MESES DE EVOLUCION. Agente. MOVIMIENTO REPETITIVO\"") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:---------|:----| | Word count | 8 | 105.2193 | 407 | | Label | Training Sample Count | |:---------------------------------------------------------------------|:----------------------| | Esfuerzo vocal | 4 | | Otros trabajos repetitivos | 22 | | Otros agentes causales | 20 | | caucho, látex natural | 2 | | Otros agentes químicos | 5 | | Otros tipos de esfuerzo | 8 | | Trabajo repetitivo con movimientos asimétricos | 1 | | Trabajar en ambiente ruidoso | 9 | | Transporte de carga al caminar | 3 | | Otro tipo de movimiento | 1 | | Otros tipos de transporte y levantamiento de cargas | 3 | | Empujar o tirar con una parte del cuerpo con movimientos repetitivos | 4 | | Caminar durante largo tiempo | 2 | | Problemas interpersonales en relación con los superiores | 10 | | Demanda excesiva de trabajo | 6 | | Hostilidad de la jefatura | 6 | | Problemas interpersonales en relación con los otros empleados | 5 | | Acoso sexual | 2 | | Ausencia de apoyo social de la empresa | 1 | ### Training Hyperparameters - batch_size: (16, 16) - num_epochs: (3, 3) - 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 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: True ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:------:|:----:|:-------------:|:---------------:| | 0.0014 | 1 | 0.2712 | - | | 0.0685 | 50 | 0.2494 | - | | 0.1370 | 100 | 0.2126 | - | | 0.2055 | 150 | 0.1226 | - | | 0.2740 | 200 | 0.1198 | - | | 0.3425 | 250 | 0.0613 | - | | 0.4110 | 300 | 0.1327 | - | | 0.4795 | 350 | 0.0533 | - | | 0.5479 | 400 | 0.0286 | - | | 0.6164 | 450 | 0.0469 | - | | 0.6849 | 500 | 0.0142 | - | | 0.7534 | 550 | 0.0056 | - | | 0.8219 | 600 | 0.0025 | - | | 0.8904 | 650 | 0.0161 | - | | 0.9589 | 700 | 0.0013 | - | | 1.0274 | 750 | 0.0016 | - | | 1.0959 | 800 | 0.0011 | - | | 1.1644 | 850 | 0.0171 | - | | 1.2329 | 900 | 0.002 | - | | 1.3014 | 950 | 0.0085 | - | | 1.3699 | 1000 | 0.0039 | - | | 1.4384 | 1050 | 0.0008 | - | | 1.5068 | 1100 | 0.0004 | - | | 1.5753 | 1150 | 0.0013 | - | | 1.6438 | 1200 | 0.0018 | - | | 1.7123 | 1250 | 0.0004 | - | | 1.7808 | 1300 | 0.0011 | - | | 1.8493 | 1350 | 0.0009 | - | | 1.9178 | 1400 | 0.0006 | - | | 1.9863 | 1450 | 0.0009 | - | | 2.0548 | 1500 | 0.0034 | - | | 2.1233 | 1550 | 0.0012 | - | | 2.1918 | 1600 | 0.0002 | - | | 2.2603 | 1650 | 0.0005 | - | | 2.3288 | 1700 | 0.0002 | - | | 2.3973 | 1750 | 0.0003 | - | | 2.4658 | 1800 | 0.0002 | - | | 2.5342 | 1850 | 0.0004 | - | | 2.6027 | 1900 | 0.0004 | - | | 2.6712 | 1950 | 0.0004 | - | | 2.7397 | 2000 | 0.0004 | - | | 2.8082 | 2050 | 0.0008 | - | | 2.8767 | 2100 | 0.0005 | - | | 2.9452 | 2150 | 0.0001 | - | ### Framework Versions - Python: 3.10.12 - SetFit: 1.0.3 - Sentence Transformers: 2.7.0 - Transformers: 4.40.2 - PyTorch: 2.2.1+cu121 - Datasets: 2.19.1 - Tokenizers: 0.19.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} } ```