File size: 2,919 Bytes
edacdde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dc0910a
edacdde
 
 
 
dc0910a
edacdde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
license: apache-2.0
language:
- en
- vi
metrics:
- f1
base_model:
- ProsusAI/finbert
pipeline_tag: fill-mask
tags:
- finance
- esg
- text-classification
- fill-mask
library_name: transformers
datasets:
- nguyen599/EnVi-ESG-200
widget:
- text: "Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation."
---

ESG analysis can help investors determine a business' long-term sustainability and identify associated risks. MaskESG-finbert-base is a [ProsusAI/finbert](https://huggingface.co/ProsusAI/finbert) model fine-tuned on [EnVi-ESG-200](https://huggingface.co/nguyen599/EnVi-ESG-200) dataset, include 200,000 annotated sentences from Vietnam, English news and ESG reports.

**Input**: A financial text.

**Output**: Environmental, Social, Governance or Neural.

**Language support**: English, Vietnamese

# How to use
You can use this model with Transformers pipeline for ESG classification or fill mask task.
```python
# tested in transformers==4.53.0
from transformers import AutoTokenizer, AutoModelForMaskedLM, pipeline

maskesg = AutoModelForMaskedLM.from_pretrained('nguyen599/MaskESG-finbert-base')
tokenizer = AutoTokenizer.from_pretrained('nguyen599/MaskESG-finbert-base')
nlp = pipeline("fill-mask", model=maskesg, tokenizer=tokenizer)
# Classification as fill-mask
results = nlp(f'Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation. This sentence is {tokenizer.mask_token}')
print(results)
# [{'score': 0.9015821814537048,
#   'token': 444,
#   'token_str': ' E',
#   'sequence': 'Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation. This sentence is E'},
#  {'score': 0.09723947197198868,
#   'token': 427,
#   'token_str': ' N',
#   'sequence': 'Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation. This sentence is N'},
#  {'score': 0.0010556845227256417,
#   'token': 322,
#   'token_str': ' S',
#   'sequence': 'Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation. This sentence is S'},
#  {'score': 0.0001152529803221114,
#   'token': 443,
#   'token_str': ' G',
#   'sequence': 'Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation. This sentence is G'},
#  {'score': 1.14425779429439e-06,
#   'token': 299,
#   'token_str': ' e',
#   'sequence': 'Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation. This sentence is e'}]

```