Text Classification
Transformers
PyTorch
English
roberta
ESG
environmental
text-embeddings-inference
Instructions to use ESGBERT/EnvRoBERTa-environmental with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ESGBERT/EnvRoBERTa-environmental with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ESGBERT/EnvRoBERTa-environmental")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ESGBERT/EnvRoBERTa-environmental") model = AutoModelForSequenceClassification.from_pretrained("ESGBERT/EnvRoBERTa-environmental", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
441eac7
1
Parent(s): c7272bf
Update README.md
Browse files
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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}},
|