nguyen599 commited on
Commit
edacdde
·
verified ·
1 Parent(s): 5cbafd0

3000 steps checkpoint

Browse files
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - vi
6
+ metrics:
7
+ - f1
8
+ base_model:
9
+ - ProsusAI/finbert
10
+ pipeline_tag: fill-mask
11
+ tags:
12
+ - finance
13
+ - esg
14
+ - text-classification
15
+ - fill-mask
16
+ library_name: transformers
17
+ datasets:
18
+ - nguyen599/ViEn-ESG-100
19
+ widget:
20
+ - text: "Over three chapters, it covers a range of topics from energy efficiency and renewable energy to the circular economy and sustainable transportation."
21
+ ---
22
+
23
+ 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 [ViEn-ESG-100](https://huggingface.co/nguyen599/ViEn-ESG-100) dataset, include 100,000 annotated sentences from Vietnam, English news and ESG reports.
24
+
25
+ **Input**: A financial text.
26
+
27
+ **Output**: Environmental, Social, Governance or Neural.
28
+
29
+ **Language support**: English, Vietnamese
30
+
31
+ # How to use
32
+ You can use this model with Transformers pipeline for ESG classification or fill mask task.
33
+ ```python
34
+ # tested in transformers==4.53.0
35
+ from transformers import AutoTokenizer, AutoModelForMaskedLM, pipeline
36
+
37
+ maskesg = AutoModelForMaskedLM.from_pretrained('nguyen599/MaskESG-finbert-base')
38
+ tokenizer = AutoTokenizer.from_pretrained('nguyen599/MaskESG-finbert-base')
39
+ nlp = pipeline("fill-mask", model=maskesg, tokenizer=tokenizer)
40
+ # Classification as fill-mask
41
+ 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}')
42
+ print(results)
43
+ # [{'score': 0.9015821814537048,
44
+ # 'token': 444,
45
+ # 'token_str': ' E',
46
+ # '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'},
47
+ # {'score': 0.09723947197198868,
48
+ # 'token': 427,
49
+ # 'token_str': ' N',
50
+ # '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'},
51
+ # {'score': 0.0010556845227256417,
52
+ # 'token': 322,
53
+ # 'token_str': ' S',
54
+ # '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'},
55
+ # {'score': 0.0001152529803221114,
56
+ # 'token': 443,
57
+ # 'token_str': ' G',
58
+ # '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'},
59
+ # {'score': 1.14425779429439e-06,
60
+ # 'token': 299,
61
+ # 'token_str': ' e',
62
+ # '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'}]
63
+
64
+ ```
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "positive",
13
+ "1": "negative",
14
+ "2": "neutral"
15
+ },
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 3072,
18
+ "label2id": {
19
+ "negative": 1,
20
+ "neutral": 2,
21
+ "positive": 0
22
+ },
23
+ "layer_norm_eps": 1e-12,
24
+ "max_position_embeddings": 512,
25
+ "model_type": "bert",
26
+ "num_attention_heads": 12,
27
+ "num_hidden_layers": 12,
28
+ "pad_token_id": 0,
29
+ "position_embedding_type": "absolute",
30
+ "torch_dtype": "bfloat16",
31
+ "transformers_version": "4.53.0",
32
+ "type_vocab_size": 2,
33
+ "use_cache": true,
34
+ "vocab_size": 30522
35
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c4112552086847f128dc12e96009d968e3f845d2839377a92948b0a19defb57
3
+ size 219052380
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff