Fill-Mask
Transformers
Safetensors
English
Vietnamese
deberta-v2
finance
esg
text-classification
bert
Instructions to use nguyen599/MaskESG-DeBERTa-v3-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nguyen599/MaskESG-DeBERTa-v3-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="nguyen599/MaskESG-DeBERTa-v3-small")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("nguyen599/MaskESG-DeBERTa-v3-small") model = AutoModelForMaskedLM.from_pretrained("nguyen599/MaskESG-DeBERTa-v3-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from nguyen599/MaskESG-DeBERTa-v3-small: direct link, hf CLI and curl.
- Browser
- Download file 2.97 kB
-
https://huggingface.co/nguyen599/MaskESG-DeBERTa-v3-small/resolve/ac3aa6bc1b108a95ca3fba1d264280b910e7f7bb/README.md
- Command line
-
hf download hf://nguyen599/MaskESG-DeBERTa-v3-small@ac3aa6bc1b108a95ca3fba1d264280b910e7f7bb/README.md
-
curl -L -o README.md https://huggingface.co/nguyen599/MaskESG-DeBERTa-v3-small/resolve/ac3aa6bc1b108a95ca3fba1d264280b910e7f7bb/README.md
2.97 kB
| license: apache-2.0 | |
| language: | |
| - en | |
| - vi | |
| metrics: | |
| - f1 | |
| base_model: | |
| - microsoft/deberta-v3-small | |
| pipeline_tag: fill-mask | |
| tags: | |
| - finance | |
| - esg | |
| - text-classification | |
| - fill-mask | |
| - bert | |
| 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-DeBERTa-v3-small is a [microsoft/deberta-v3-small](https://huggingface.co/microsoft/deberta-v3-small) 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-DeBERTa-v3-small') | |
| tokenizer = AutoTokenizer.from_pretrained('nguyen599/MaskESG-DeBERTa-v3-small') | |
| 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'}] | |
| ``` | |