setfit safetensors bert sentence-transformers text-classification generated_from_setfit_trainer dataset:GIZ/policy_classification arxiv:2209.11055 base_model:BAAI/bge-base-en-v1.5 base_model:finetune:BAAI/bge-base-en-v1.5 co2_eq_emissions region:us
---
base_model: BAAI/bge-base-en-v1.5
datasets:
- GIZ/policy_classification
library_name: setfit
metrics:
- accuracy
pipeline_tag: text-classification
tags:
- setfit
- sentence-transformers
- text-classification
- generated_from_setfit_trainer
widget:
- text: Unconditional Reduction The level of reduction planned unconditionally is
    expected to be up to 35% by 2030 as compared to the Business As Usual (BAU) scenario,
    taking 2005 as the reference year.  Conditional Reduction In a conditional mitigation
    scenario Angola plans to reduce further its emissions. Therefore, the mitigation
    options identified in this scenario are expected to reduce an additional 15% below
    BAU emission levels by 2030.
- text: Measure 300 MW total installed biomass power capacity in the country by Sector
    Energy GHG mitigation target 84 ktCO2e on average per year between 2020 and 2030
    Monitoring procedures Newly added biomass capacity will be monitored on an annual
    basis by the Department of Climate Change of the Ministry of Natural Resources
    and Environment using data from the Ministry of Energy and Mines  Comments - Installed
    capacity as of 2019 is around 40MW  Measure 30% Electric Vehicles penetration
    for 2-wheelers and passengers  cars in national vehicles mix Sector Transport
    GHG mitigation target 30 ktCO2e on average per year between 2020 and 2030 Monitoring
    procedures Share of Electric Vehicles in national vehicle mix will be monitored
    on an annual basis by the Department of Climate Change of the Ministry of Natural
    Resources and Environment using data from the Ministry of Public Works and Transport.
- text: � Australia adopts a target of net zero emissions by 2050. This is an economy-wide
    target, covering all sectors and gases included in Australia’s national inventory.
    � In order to achieve net zero by 2050, Australia commits to seven low emissions
    technology stretch goals - ambitious but realistic goals to bring priority low
    emissions technologies to economic parity with existing mature technologies.
- text: 'The GoP has taken a series of major initiatives as outlined in chapters 4
    and 5. Hence, Pakistan intends to set a cumulative ambitious conditional target
    of overall 50% reduction of its projected emissions by 2030, with 15% from the
    country’s own resources and 35% subject to provision of international grant ﬁnance
    that would require USD 101 billion just for energy transition. 7.1  HIGH PRIORITY
    ACTIONS Addressing the Global Climate Summit at the United Nations in December
    2020, the Prime Minister of Pakistan made an announcement to reduce future GHG
    emissions on a high priority basis if international ﬁnancial and technical resources
    were made available: MITIGATION: 1.'
- text: This document enfolds Iceland’s first communication on its long-term strategy
    (LTS), to be updated when further analysis and policy documents are published
    on the matter. Iceland is committed to reducing its overall greenhouse gas emissions
    and reaching climate neutrality no later than 2040 and become fossil fuel free
    in 2050, which should set Iceland on a path to net negative emissions.
inference: false
co2_eq_emissions:
  emissions: 268.4261122496047
  source: codecarbon
  training_type: fine-tuning
  on_cloud: false
  cpu_model: Intel(R) Xeon(R) CPU @ 2.20GHz
  ram_total_size: 12.674789428710938
  hours_used: 2.03
  hardware_used: 1 x Tesla V100-SXM2-16GB
---

# SetFit with BAAI/bge-base-en-v1.5

This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) as the Sentence Transformer embedding model. A [SetFitHead](huggingface.co/docs/setfit/reference/main#setfit.SetFitHead) 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
The purpose of this model is to predict multiple labels simultaneously from a given input data. Specifically, the model will predict 3 labels - 
GHGLabel, NetzeroLabel, NonGHGLabel- that are relevant to a particular task or application
- **GHGLabel**: GHG targets refer to contributions framed as targeted \
                              outcomes in GHG terms
- **NetzeroLabel**: Identifies if it contains Netzero Target or not.
- **NonGHGLabel**: Target not in terms of GHG, like energy efficiency, expansion of Solar Energy production etc.

### Model Description
- **Model Type:** SetFit
- **Sentence Transformer body:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5)
- **Classification head:** a [SetFitHead](huggingface.co/docs/setfit/reference/main#setfit.SetFitHead) instance
- **Maximum Sequence Length:** 512 tokens
- **Number of Classes:** 3 classes
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->

### 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)

## 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("GIZ/SUBTARGET_multilabel_bge")
# Run inference
preds = model("This document enfolds Iceland’s first communication on its long-term strategy (LTS), to be updated when further analysis and policy documents are published on the matter. Iceland is committed to reducing its overall greenhouse gas emissions and reaching climate neutrality no later than 2040 and become fossil fuel free in 2050, which should set Iceland on a path to net negative emissions.")
```

<!--
### Downstream Use

*List how someone could finetune this model on their own dataset.*
-->

<!--
### Out-of-Scope Use

*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->

<!--
## Bias, Risks and Limitations

*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->

<!--
### Recommendations

*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->

## Training Details

### Training Set Metrics
| Training set | Min | Median  | Max |
|:-------------|:----|:--------|:----|
| Word count   | 19  | 78.5467 | 173 |

- Training Dataset: 728
| Class | Positive Count of Class|
|:-------------|:--------|
| GHGLabel | 440 |
| NetzeroLabel | 120 |
| NonGHGLabel | 259|


- Validation Dataset: 80
| Class | Positive Count of Class|
|:-------------|:--------|
| GHGLabel | 49 |
| NetzeroLabel | 11 |
| NonGHGLabel | 30|


### Training Hyperparameters
- batch_size: (8, 2)
- num_epochs: (1, 0)
- max_steps: -1
- sampling_strategy: undersampling
- body_learning_rate: (6.86e-06, 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.01
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False

### Embedding Training Results
| Epoch  | Step  | Training Loss | Validation Loss |
|:------:|:-----:|:-------------:|:---------------:|
| 0.0000 | 1     | 0.2227        | -               |
| 0.1519 | 5000  | 0.015         | 0.0831          |
| 0.3038 | 10000 | 0.0146        | 0.0924          |
| 0.4557 | 15000 | 0.0197        | 0.0827          |
| 0.6076 | 20000 | 0.0031        | 0.0883          |
| 0.7595 | 25000 | 0.0439        | 0.0865          |
| 0.9114 | 30000 | 0.0029        | 0.0914          |

|label          | precision |recall |f1-score| support|
|:-------------:|:---------:|:-----:|:------:|:------:|
|GHG	|0.884   	|0.938  |0.910   |	49.0  |
|Netzero	        |0.846	    |1.000  |0.916   |	11.0  |
|NonGHG	|0.903      |0.933  |0.918   |	30.0  |


### Environmental Impact
Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
- **Carbon Emitted**: 0.268 kg of CO2
- **Hours Used**: 2.03 hours

### Training Hardware
- **On Cloud**: No
- **GPU Model**: 1 x Tesla V100-SXM2-16GB
- **CPU Model**: Intel(R) Xeon(R) CPU @ 2.20GHz
- **RAM Size**: 12.67 GB

### Framework Versions
- Python: 3.10.12
- SetFit: 1.0.3
- Sentence Transformers: 2.3.1
- Transformers: 4.35.2
- PyTorch: 2.1.0+cu121
- Datasets: 2.17.0
- 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}
}
```

<!--
## Glossary

*Clearly define terms in order to be accessible across audiences.*
-->

<!--
## Model Card Authors

*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->

<!--
## Model Card Contact

*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->