--- library_name: setfit tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer metrics: - accuracy widget: - text: This paper focuses on mining association rules between sets of items in large databases, which can reveal interesting patterns and relationships among the data. - text: In this paper, the authors explore the economic concepts of fairness and retaliation within the context of reciprocity, demonstrating how these principles shape market behaviors and interactions. - text: Further research is needed to explore the applicability of the proposed model to more complex multi-echelon inventory systems with additional features, such as lead time variability and supplier reliability. - text: The NCEP/NCAR 40-Year Reanalysis Project provides retrospective atmospheric data sets by assimilating observational data into a model, resulting in improved estimates of historical weather patterns for meteorological research and applications. - text: This study aims to assess the accuracy of aerosol optical properties retrieved from Aerosol Robotic Network (AERONET) Sun and sky radiance measurements using ground-based reference data. pipeline_tag: text-classification inference: true base_model: sentence-transformers/paraphrase-MiniLM-L3-v2 model-index: - name: SetFit with sentence-transformers/paraphrase-MiniLM-L3-v2 results: - task: type: text-classification name: Text Classification dataset: name: Unknown type: unknown split: test metrics: - type: accuracy value: 0.7407692307692307 name: Accuracy --- # SetFit with sentence-transformers/paraphrase-MiniLM-L3-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-MiniLM-L3-v2](https://huggingface.co/sentence-transformers/paraphrase-MiniLM-L3-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-MiniLM-L3-v2](https://huggingface.co/sentence-transformers/paraphrase-MiniLM-L3-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:** 13 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 | |:----------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Aims | | | Background | | | Hypothesis | | | Implications | | | Importance | | | Keywords | | | Limitations | | | Method | | | None | | | Purpose | | | Reccomendations | | | Result | | | Uncertainty | | ## Evaluation ### Metrics | Label | Accuracy | |:--------|:---------| | **all** | 0.7408 | ## 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("Corran/SciGenSetfit") # Run inference preds = model("This paper focuses on mining association rules between sets of items in large databases, which can reveal interesting patterns and relationships among the data.") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 11 | 28.3123 | 71 | | Label | Training Sample Count | |:----------------|:----------------------| | Aims | 200 | | Background | 200 | | Hypothesis | 200 | | Implications | 200 | | Importance | 200 | | Keywords | 200 | | Limitations | 200 | | Method | 200 | | None | 200 | | Purpose | 200 | | Reccomendations | 200 | | Result | 200 | | Uncertainty | 200 | ### Training Hyperparameters - batch_size: (256, 256) - num_epochs: (1, 1) - max_steps: -1 - sampling_strategy: oversampling - num_iterations: 40 - 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: False ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:------:|:----:|:-------------:|:---------------:| | 0.0012 | 1 | 0.4201 | - | | 0.0615 | 50 | 0.2562 | - | | 0.1230 | 100 | 0.2334 | - | | 0.1845 | 150 | 0.1974 | - | | 0.2460 | 200 | 0.195 | - | | 0.3075 | 250 | 0.1768 | - | | 0.3690 | 300 | 0.146 | - | | 0.4305 | 350 | 0.1541 | - | | 0.4920 | 400 | 0.1647 | - | | 0.5535 | 450 | 0.154 | - | | 0.6150 | 500 | 0.1568 | - | | 0.6765 | 550 | 0.1494 | - | | 0.7380 | 600 | 0.1554 | - | | 0.7995 | 650 | 0.1456 | - | | 0.8610 | 700 | 0.1527 | - | | 0.9225 | 750 | 0.1488 | - | | 0.9840 | 800 | 0.1312 | - | ### Framework Versions - Python: 3.10.12 - SetFit: 1.0.3 - Sentence Transformers: 2.2.2 - Transformers: 4.36.2 - PyTorch: 2.1.0+cu121 - Datasets: 2.16.1 - Tokenizers: 0.15.0 ## 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} } ```