--- tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: The Government of Timor-Leste has made enormous political commitments to improve nutrition since independence. The importance of improving nutrition is highlighted as a priority area of intervention in several national strategic documents and policies including Timor-Leste Strategic Development Plan (2011-2030), National Health Sector Strategic Plan (2011-2030) the National Nutrition Strategy (2014-2019); National Food and Nutrition Security Policy (2017); and The Zero Hunger for a Hunger and Malnutrition Free Timor-Leste (PAN-HAM-TL) 2015-2025. - text: Climate Risk and Vulnerability Baseline. One of the key roles of the NAP process is to develop a common evidence base on CC that can be referenced by stakeholders in various documents, including strategies and project proposals. Therefore, climate risk and vulnerability assessments shall be summarized and updated on a periodical basis to underlie the development of the NAP and the list of m - text: 'Agriculture in Armenia has always been remarkable with the high level of climate risks (hail damage, frost damage, drought, etc.). As it is already mentioned, agriculture has suffered losses from natural disasters worth of AMD 110 billion during the recent 6 years. Climate risks in Armenia are a serious problem since there are no clearly formed such state, political or institutional mechanisms, the application of which would make it possible to noticeably mitigate the existing risks. Due to the lack of such mechanisms, the mechanism of full assessment of the agricultural losses does not work too, as well as the risks are not assessed in advance. In this context, to reduce the agricultural risks, to introduce loss compensation mechanisms in a systemized way, and to provide sustainable income levels for economic entities, it is necessary to address the critical issue of agricultural risk insurance. ' - text: 'Since the development of the first National Nutrition Strategy of Timor-Leste in 2004, there have been several emerging global, regional and national initiatives to accelerate improvements in nutritional status. ' - text: 'Food security of the population is one of the key challenges of the twenty-first century. In the mid-term perspective, it is one of the main directions of ensuring the country’s national security, a factor in maintaining statehood and sovereignty, and the most important component of demographic policy implementation. Furthermore, food security is a sough- for precondition in terms of improving population’s quality of life by safeguarding appropriate livelihood standards. 8. The problem of providing the population with food has long been there, however since mid-20th century, in the context of streamlining the problems of scarce world food resources, this issue gained a special attention. The development of fundamental human rights documents, such as the Universal Declaration of Human Rights, 1948, the International Covenant on Economic, Social and Cultural Rights, 1966 and others, also played a crucial role. The term "food security" has been first coined by the WFS of 1974, which was defined as: “Maintaining stability and availability of food stuff in the markets for all countries of the world.” 9. At the current stage of development, the perception of food security has significantly expanded. Thus, in 1996, World Food Security Summit, “food security” has been defined ' metrics: - accuracy pipeline_tag: text-classification library_name: setfit inference: true base_model: sentence-transformers/paraphrase-mpnet-base-v2 --- # SetFit with sentence-transformers/paraphrase-mpnet-base-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-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. 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-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 512 tokens - **Number of Classes:** 5 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 | |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 6.3.4 Effectiveness of Policy Implementation: Assesses how well policies are executed, supported, and monitored, ensuring that institutions deliver on their commitments and enable positive outcomes. | | | 1.1. Food Security & Nutrition: Encompasses ensuring everyone’s access to sufficient, safe, and nutritious food, improving overall dietary intake and nutritional well-being. | | | 5.2 Resilience Capacities (absorptive, adaptive & transformative): Promotes building skills, diversifying options, strengthening networks, and improving surveillance systems so that communities, ecosystems, and value chains can withstand and recover from disruptions. | | | 1.2. Diet quality: Focuses on the balance, diversity, and healthfulness of what people eat, aiming to prevent malnutrition and diet-related diseases. | | | 6.3.3 Awareness and use of the evidence-based / agrifood systems approach: Encourages long-term, integrated planning for agrifood systems, guided by robust data, stakeholder consensus, and strategic foresight. | | ## 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("faodl/setfit-paraphrase-mpnet-base-v2-5ClassesDesc-augmented-v02") # Run inference preds = model("Since the development of the first National Nutrition Strategy of Timor-Leste in 2004, there have been several emerging global, regional and national initiatives to accelerate improvements in nutritional status. ") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:---------|:-----| | Word count | 7 | 105.1494 | 1014 | | Label | Training Sample Count | |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------| | 6.3.4 Effectiveness of Policy Implementation: Assesses how well policies are executed, supported, and monitored, ensuring that institutions deliver on their commitments and enable positive outcomes. | 27 | | 1.1. Food Security & Nutrition: Encompasses ensuring everyone’s access to sufficient, safe, and nutritious food, improving overall dietary intake and nutritional well-being. | 67 | | 5.2 Resilience Capacities (absorptive, adaptive & transformative): Promotes building skills, diversifying options, strengthening networks, and improving surveillance systems so that communities, ecosystems, and value chains can withstand and recover from disruptions. | 22 | | 1.2. Diet quality: Focuses on the balance, diversity, and healthfulness of what people eat, aiming to prevent malnutrition and diet-related diseases. | 23 | | 6.3.3 Awareness and use of the evidence-based / agrifood systems approach: Encourages long-term, integrated planning for agrifood systems, guided by robust data, stakeholder consensus, and strategic foresight. | 35 | ### Training Hyperparameters - batch_size: (8, 8) - num_epochs: (1, 1) - 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 - l2_weight: 0.01 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: True ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:------:|:----:|:-------------:|:---------------:| | 0.0004 | 1 | 0.2349 | - | | 0.0175 | 50 | 0.23 | - | | 0.0351 | 100 | 0.2089 | - | | 0.0526 | 150 | 0.1986 | - | | 0.0701 | 200 | 0.1648 | - | | 0.0876 | 250 | 0.1593 | - | | 0.1052 | 300 | 0.1308 | - | | 0.1227 | 350 | 0.1049 | - | | 0.1402 | 400 | 0.0829 | - | | 0.1577 | 450 | 0.0851 | - | | 0.1753 | 500 | 0.0442 | - | | 0.1928 | 550 | 0.046 | - | | 0.2103 | 600 | 0.0467 | - | | 0.2278 | 650 | 0.0416 | - | | 0.2454 | 700 | 0.0391 | - | | 0.2629 | 750 | 0.0353 | - | | 0.2804 | 800 | 0.0296 | - | | 0.2979 | 850 | 0.0271 | - | | 0.3155 | 900 | 0.0231 | - | | 0.3330 | 950 | 0.0356 | - | | 0.3505 | 1000 | 0.0268 | - | | 0.3680 | 1050 | 0.0314 | - | | 0.3856 | 1100 | 0.037 | - | | 0.4031 | 1150 | 0.0322 | - | | 0.4206 | 1200 | 0.0223 | - | | 0.4381 | 1250 | 0.0357 | - | | 0.4557 | 1300 | 0.0242 | - | | 0.4732 | 1350 | 0.0374 | - | | 0.4907 | 1400 | 0.0275 | - | | 0.5082 | 1450 | 0.0189 | - | | 0.5258 | 1500 | 0.0236 | - | | 0.5433 | 1550 | 0.0317 | - | | 0.5608 | 1600 | 0.0324 | - | | 0.5783 | 1650 | 0.0241 | - | | 0.5959 | 1700 | 0.0184 | - | | 0.6134 | 1750 | 0.0285 | - | | 0.6309 | 1800 | 0.0243 | - | | 0.6484 | 1850 | 0.017 | - | | 0.6660 | 1900 | 0.0247 | - | | 0.6835 | 1950 | 0.0194 | - | | 0.7010 | 2000 | 0.0368 | - | | 0.7185 | 2050 | 0.0199 | - | | 0.7361 | 2100 | 0.0228 | - | | 0.7536 | 2150 | 0.0262 | - | | 0.7711 | 2200 | 0.0222 | - | | 0.7886 | 2250 | 0.0188 | - | | 0.8062 | 2300 | 0.0167 | - | | 0.8237 | 2350 | 0.0331 | - | | 0.8412 | 2400 | 0.0275 | - | | 0.8587 | 2450 | 0.0239 | - | | 0.8763 | 2500 | 0.025 | - | | 0.8938 | 2550 | 0.0194 | - | | 0.9113 | 2600 | 0.0366 | - | | 0.9288 | 2650 | 0.0333 | - | | 0.9464 | 2700 | 0.0281 | - | | 0.9639 | 2750 | 0.0162 | - | | 0.9814 | 2800 | 0.0304 | - | | 0.9989 | 2850 | 0.0306 | - | | 1.0 | 2853 | - | 0.2305 | ### Framework Versions - Python: 3.11.11 - SetFit: 1.1.1 - Sentence Transformers: 3.4.1 - Transformers: 4.48.3 - PyTorch: 2.5.1+cu124 - Datasets: 3.5.0 - Tokenizers: 0.21.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} } ```