tobischimanski commited on
Commit
441eac7
1 Parent(s): c7272bf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -2
README.md CHANGED
@@ -14,9 +14,30 @@ This is the EnvRoBERTa-environmental language model. A language model that is tr
14
 
15
  Using the [EnvRoBERTa-base](https://huggingface.co/ESGBERT/EnvRoBERTa-base) model as a starting point, the EnvRoBERTa-environmental Language Model is additionally fine-trained on a 2k environmental dataset to detect environmental text samples.
16
 
17
- Get started:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- More details can be found in the paper:
20
  ```bibtex
21
  @article{Schimanski23ESGBERT,
22
  title={{Bridiging the Gap in ESG Measurement: Using NLP to Quantify Environmental, Social, and Governance Communication}},
 
14
 
15
  Using the [EnvRoBERTa-base](https://huggingface.co/ESGBERT/EnvRoBERTa-base) model as a starting point, the EnvRoBERTa-environmental Language Model is additionally fine-trained on a 2k environmental dataset to detect environmental text samples.
16
 
17
+ ## How to Get Started With the Model
18
+ You can use the model with a pipeline for text classification:
19
+
20
+ ```python
21
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
22
+ from transformers.pipelines.pt_utils import KeyDataset
23
+ import datasets
24
+ from tqdm.auto import tqdm
25
+
26
+ dataset_name = "climatebert/climate_detection"
27
+ tokenizer_name = "ESGBERT/EnvRoBERTa-environmental"
28
+ model_name = "ESGBERT/EnvRoBERTa-environmental"
29
+
30
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
31
+ tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, max_len=512)
32
+
33
+ pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)
34
+
35
+ # See https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
36
+ print(pipe("Scope 1 emissions are reported here on a like-for-like basis against the 2013 baseline and exclude emissions from additional vehicles used during repairs."))
37
+ ```
38
+
39
+ ## More details can be found in the paper
40
 
 
41
  ```bibtex
42
  @article{Schimanski23ESGBERT,
43
  title={{Bridiging the Gap in ESG Measurement: Using NLP to Quantify Environmental, Social, and Governance Communication}},