--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer base_model: desarrolloasesoreslocales/bert-leg-al-corpus metrics: - accuracy widget: - text: Quiero manifestar la poca eficiencia y falta de señalización de señales de prohibición o advertencia de prohibición para estacionar en la zona en la que fui sancionado durante todo el itinerario que recorrí con el vehículo hasta dejarlo estacionado en la plaza de aparcamiento donde fue sancionado. - text: se me notifique expresamente el informe del agente denunciante - text: 'Por ello y al amparo del derecho reconocido en el art. 95 del Texto Refundido de la Ley de Seguridad Vial, solicita expresamente se remita prueba documental: --En la que consten los datos relativos a la señal que pudiera existir, así como el estado de conservación de la misma. ' - text: 'La resolución sancionadora es el primer acto administrativo relativo al Expediente n” [NUMERO]/2021/[NUMERO] que me ha notificado, no teniendo constancia de la existencia de denuncia, (ya que no encontré en el parabrisas la supuesta denuncia) ni de su notificación (si es que hubo denuncia), ni de requerimiento dirigido al titular de vehículo para que identifique al conductor. Así, tanto el art. 9 Real Decreto 320/1994, como el art. 77 del Real Decreto Legislativo 339/1990, imponen a la Administración la obligación de notificar la denuncia al infractor, para que pueda continuarse la tramitación del procedimiento sancionador. En este caso, la notificación no se ha producido, y a pesar de ello, ha sido dictada la Resolución Sancionadora; por tanto, concurre un vicio de nulidad de pleno derecho en la resolución recurrida, de conformidad con el art. 62.e) de la Ley 30/1992 de Régimen Jurídico de las Administraciones Públicas y Procedimiento Administrativo Comun.' - text: 'APERTURA DEL PERÍODO PROBATORIO. Que para el conocimiento correcto del hecho y de conformidad con el Reglamento de Procedimiento sancionador en materia de tráfico, se proceda por el instructor a la apertura del periodo de prueba, comunicando a este exponente la fecha de inicio y las pruebas admitidas. Y solicita como MEDIOS PROBATORIOS' pipeline_tag: text-classification inference: true model-index: - name: SetFit with desarrolloasesoreslocales/bert-leg-al-corpus results: - task: type: text-classification name: Text Classification dataset: name: Unknown type: unknown split: test metrics: - type: accuracy value: 0.8736842105263158 name: Accuracy --- # SetFit with desarrolloasesoreslocales/bert-leg-al-corpus This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [desarrolloasesoreslocales/bert-leg-al-corpus](https://huggingface.co/desarrolloasesoreslocales/bert-leg-al-corpus) 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:** [desarrolloasesoreslocales/bert-leg-al-corpus](https://huggingface.co/desarrolloasesoreslocales/bert-leg-al-corpus) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 4096 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 | |:------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 49 | | | 2037 | | | 2060 | | | 2017 | | | 2039 | | | 2026 | | | 1001 | | | 2002 | | | 2014 | | | 2038 | | | 353 | | | 304 | | | 2027 | | | 994 | | | 2010 | | | 2013 | | | 357 | | | 78 | | | 2001 | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.8737 | ## 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("desarrolloasesoreslocales/bert-leg-al-setfit") # Run inference preds = model("se me notifique expresamente el informe del agente denunciante") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 3 | 45.3105 | 213 | | Label | Training Sample Count | |:------|:----------------------| | 49 | 10 | | 78 | 10 | | 304 | 10 | | 353 | 10 | | 357 | 10 | | 994 | 10 | | 1001 | 10 | | 2001 | 10 | | 2002 | 10 | | 2010 | 10 | | 2013 | 10 | | 2014 | 10 | | 2017 | 10 | | 2026 | 10 | | 2027 | 10 | | 2037 | 10 | | 2038 | 10 | | 2039 | 10 | | 2060 | 10 | ### Training Hyperparameters - batch_size: (48, 48) - num_epochs: (1, 1) - max_steps: -1 - sampling_strategy: oversampling - num_iterations: 60 - body_learning_rate: (3e-06, 3e-06) - head_learning_rate: 3e-06 - loss: CosineSimilarityLoss - distance_metric: cosine_distance - margin: 0.25 - end_to_end: False - use_amp: True - warmup_proportion: 0.1 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: False ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:------:|:----:|:-------------:|:---------------:| | 0.0014 | 1 | 0.1284 | - | | 0.0701 | 50 | 0.0745 | - | | 0.1403 | 100 | 0.0349 | - | | 0.2104 | 150 | 0.0897 | - | | 0.2805 | 200 | 0.0552 | - | | 0.3506 | 250 | 0.0313 | - | | 0.4208 | 300 | 0.0181 | - | | 0.4909 | 350 | 0.0305 | - | | 0.5610 | 400 | 0.0342 | - | | 0.6311 | 450 | 0.0289 | - | | 0.7013 | 500 | 0.0189 | - | | 0.7714 | 550 | 0.0142 | - | | 0.8415 | 600 | 0.0273 | - | | 0.9116 | 650 | 0.0076 | - | | 0.9818 | 700 | 0.0492 | - | | 0.0018 | 1 | 0.0341 | - | | 0.0921 | 50 | 0.0062 | - | | 0.1842 | 100 | 0.0154 | - | | 0.2762 | 150 | 0.0129 | - | | 0.3683 | 200 | 0.0369 | - | | 0.4604 | 250 | 0.0165 | - | | 0.5525 | 300 | 0.0266 | - | | 0.6446 | 350 | 0.0387 | - | | 0.7366 | 400 | 0.024 | - | | 0.8287 | 450 | 0.0621 | - | | 0.9208 | 500 | 0.0336 | - | | 0.0021 | 1 | 0.0362 | - | | 0.1053 | 50 | 0.0103 | - | | 0.2105 | 100 | 0.0118 | - | | 0.3158 | 150 | 0.012 | - | | 0.4211 | 200 | 0.0041 | - | | 0.5263 | 250 | 0.0046 | - | | 0.6316 | 300 | 0.0121 | - | | 0.7368 | 350 | 0.0239 | - | | 0.8421 | 400 | 0.0184 | - | | 0.9474 | 450 | 0.0465 | - | | 0.0021 | 1 | 0.0341 | - | | 0.1053 | 50 | 0.0088 | - | | 0.2105 | 100 | 0.0063 | - | | 0.3158 | 150 | 0.0061 | - | | 0.4211 | 200 | 0.0023 | - | | 0.5263 | 250 | 0.0018 | - | | 0.6316 | 300 | 0.0073 | - | | 0.7368 | 350 | 0.0113 | - | | 0.8421 | 400 | 0.0114 | - | | 0.9474 | 450 | 0.0216 | - | ### Framework Versions - Python: 3.10.12 - SetFit: 1.0.3 - Sentence Transformers: 3.0.0 - Transformers: 4.39.2 - PyTorch: 2.3.0+cu121 - Datasets: 2.19.1 - Tokenizers: 0.15.2 ## 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} } ```