Views
No views yet
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3# Load model and tokenizer
4model = AutoModelForSequenceClassification.from_pretrained("chungpt2123/esg-subfactor-classifier", trust_remote_code=True)
5tokenizer = AutoTokenizer.from_pretrained("Alibaba-NLP/gte-multilingual-base")
6
7# Example usage
8text = "The company has implemented renewable energy solutions to reduce carbon emissions."
9inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=4096)
10
11# Get predictions
12esg_factor, sub_factor = model.predict(inputs.input_ids, inputs.attention_mask)
13print(f"ESG Factor: {esg_factor}, Sub-factor: {sub_factor}")1@misc{esg_hierarchical_model,
2 title={ESG Hierarchical Multi-Task Learning Model},
3 author={Chung},
4 year={2024},
5 publisher={Hugging Face},
6 url={https://huggingface.co/chungpt2123/test1}
7}