This repository contains a fine-tuned DistilBERT model using the esg-sentiment dataset. DistilBERT, a distilled version of BERT, is a powerful transformer-based model for natural language processing tasks. The model has been fine-tuned on the ESG (Environmental, Social, and Governance) sentiment dataset, allowing it to capture nuanced sentiments related to sustainability and corporate responsibility.
Features
DistilBERT-based architecture
Fine-tuned on the esg-sentiment dataset
Optimized for sentiment analysis in the context of ESG
Usage
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
import torch
tokenizer = DistilBertTokenizer.from_pretrained('descartes100/distilBERT_ESG')
model = DistilBertForSequenceClassification.from_pretrained('descartes100/distilBERT_ESG')
text = "Our waste reduction initiatives aim to minimize environmental impact. From recycling programs to waste reduction technologies, we're dedicated to responsibly managing resources."
encoding = tokenizer(text, return_tensors="pt")
encoding = {k: v.to(trainer.model.device) for k,v in encoding.items()}
outputs = model(**encoding)
logits = outputs.logits
sigmoid = torch.nn.Sigmoid()
probs = sigmoid(logits.squeeze().cpu())
predictions = np.zeros(probs.shape)
predictions[np.where(probs >= 0.5)] = 1
for idx, label in enumerate(predictions):
print(id2label[idx], ':', label)
The fine-tuned DistilBERT model is designed for sentiment analysis tasks related to ESG considerations. It can be used to analyze and classify text data, providing insights into the sentiment towards environmental, social, and governance practices.
Limitations
The model's performance is directly influenced by the quality and diversity of the training data.
It may not generalize well to domains outside the ESG context.
Users are encouraged to validate results on their specific use cases and datasets.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
learning_rate: 2e-05
train_batch_size: 8
eval_batch_size: 8
seed: 42
optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08