Text Classification
Transformers
PyTorch
roberta
Inference Endpoints
File size: 1,998 Bytes
61a871b
 
994feaf
 
61a871b
c129880
ab8795e
 
 
 
ec9be32
ab8795e
 
 
 
bd107b6
 
 
 
 
 
 
ab8795e
 
 
 
 
 
 
 
 
 
 
 
 
8b05557
ab8795e
 
 
 
 
 
 
 
 
 
 
60a3ac7
 
 
ab8795e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
license: apache-2.0
datasets:
- climatebert/netzero_reduction_data
---
# Model Card for netzero-reduction

## Model Description

This is the fine-tuned ClimateBERT language model with a classification head for detecting sentences that are either related to emission net zero or reduction targets. 
We use the [climatebert/distilroberta-base-climate-f](https://huggingface.co/climatebert/distilroberta-base-climate-f) language model as a starting point and fine-tuned it on our human-annotated dataset.
 
## Citation Information

```bibtex
@article{schimanski2023climatebertnetzero,
      title={ClimateBERT-NetZero: Detecting and Assessing Net Zero and Reduction Targets}, 
      author={Tobias Schimanski and Julia Bingler and Camilla Hyslop and Mathias Kraus and Markus Leippold},
      year={2023},
      eprint={2310.08096},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}
```

## How to Get Started With the Model
You can use the model with a pipeline for text classification:

```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
from transformers.pipelines.pt_utils import KeyDataset
import datasets
from tqdm.auto import tqdm
 
dataset_name = "climatebert/climate_detection"
tokenizer_name = "climatebert/distilroberta-base-climate-f"
model_name = "climatebert/netzero-reduction"
 
# If you want to use your own data, simply load them as 🤗 Datasets dataset, see https://huggingface.co/docs/datasets/loading
dataset = datasets.load_dataset(dataset_name, split="test")
 
model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, max_len=512)
 
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)
 
# See https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
for i, out in enumerate(tqdm(pipe(KeyDataset(dataset, "text"), padding=True, truncation=True))):
  print(dataset["text"][i])
  print(out)
```