Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,47 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
+
# Model Card for transition-physical
|
5 |
+
|
6 |
+
## Model Description
|
7 |
+
|
8 |
+
This is the fine-tuned ClimateBERT language model with a classification head for detecting sentences that are either related to transition risks or to physical climate risks.
|
9 |
+
Using the [climatebert/distilroberta-base-climate-f](https://huggingface.co/climatebert/distilroberta-base-climate-f) language model as starting point, the distilroberta-base-climate-detector model is fine-tuned on our human-annotated dataset.
|
10 |
+
|
11 |
+
## Citation Information
|
12 |
+
|
13 |
+
```bibtex
|
14 |
+
@article{deng2023war,
|
15 |
+
title={War and Policy: Investor Expectations on the Net-Zero Transition},
|
16 |
+
author={Deng, Ming and Leippold, Markus and Wagner, Alexander F and Wang, Qian},
|
17 |
+
journal={Swiss Finance Institute Research Paper},
|
18 |
+
number={22-29},
|
19 |
+
year={2023}
|
20 |
+
}
|
21 |
+
```
|
22 |
+
|
23 |
+
## How to Get Started With the Model
|
24 |
+
You can use the model with a pipeline for text classification:
|
25 |
+
|
26 |
+
```python
|
27 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
|
28 |
+
from transformers.pipelines.pt_utils import KeyDataset
|
29 |
+
import datasets
|
30 |
+
from tqdm.auto import tqdm
|
31 |
+
|
32 |
+
dataset_name = "climatebert/climate_detection"
|
33 |
+
tokenizer_name = “"climatebert/distilroberta-base-climate-detector"
|
34 |
+
model_name = "climatebert/transition-physical"
|
35 |
+
|
36 |
+
# If you want to use your own data, simply load them as 🤗 Datasets dataset, see https://huggingface.co/docs/datasets/loading
|
37 |
+
dataset = datasets.load_dataset(dataset_name, split="test")
|
38 |
+
|
39 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
40 |
+
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, max_len=512)
|
41 |
+
|
42 |
+
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)
|
43 |
+
|
44 |
+
# See https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
|
45 |
+
for out in tqdm(pipe(KeyDataset(dataset, "text"), padding=True, truncation=True)):
|
46 |
+
print(out)
|
47 |
+
```
|