financebert / model_update.py
marcev's picture
Update label mappings for FinanceBERT
f858656
from transformers import AutoModelForSequenceClassification
# Load your model
model = AutoModelForSequenceClassification.from_pretrained('path_to_your_local_model')
# Update label mapping
model.config.id2label = {0: 'Negative', 1: 'Neutral', 2: 'Positive'}
model.config.label2id = {'Negative': 0, 'Neutral': 1, 'Positive': 2}