Text Classification
Transformers
PyTorch
roberta
Inference Endpoints
tobischimanski commited on
Commit
ab8795e
1 Parent(s): ac90a0d

Adjust readme

Browse files
Files changed (1) hide show
  1. README.md +42 -0
README.md CHANGED
@@ -1,3 +1,45 @@
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 emission net zero or reduction targets.
9
+ We use 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={ClimateBERT-NetZero: Detecting and Assessing Net Zero and Reduction Targets},
16
+ author={Tobias Schimanski and Julia Bingler and Camilla Hyslop and Mathias Kraus and Markus Leippold},
17
+ year={2023}
18
+ }
19
+ ```
20
+
21
+ ## How to Get Started With the Model
22
+ You can use the model with a pipeline for text classification:
23
+
24
+ ```python
25
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
26
+ from transformers.pipelines.pt_utils import KeyDataset
27
+ import datasets
28
+ from tqdm.auto import tqdm
29
+
30
+ dataset_name = "climatebert/climate_detection"
31
+ tokenizer_name = “"climatebert/distilroberta-base-climate-f"
32
+ model_name = "climatebert/netzero-reduction"
33
+
34
+ # If you want to use your own data, simply load them as 🤗 Datasets dataset, see https://huggingface.co/docs/datasets/loading
35
+ dataset = datasets.load_dataset(dataset_name, split="test")
36
+
37
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
38
+ tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, max_len=512)
39
+
40
+ pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)
41
+
42
+ # See https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
43
+ for out in tqdm(pipe(KeyDataset(dataset, "text"), padding=True, truncation=True)):
44
+ print(out)
45
+ ```