BA BIC BDA - Serloth-Schwarzer 2024
Collection
3 items โข Updated
How to use mserloth/v23 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="mserloth/v23") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mserloth/v23")
model = AutoModelForSequenceClassification.from_pretrained("mserloth/v23", device_map="auto")# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mserloth/v23")
model = AutoModelForSequenceClassification.from_pretrained("mserloth/v23", device_map="auto")loss: 0.5765425562858582
f1_macro: 0.7349736157447978
f1_micro: 0.7492063492063492
f1_weighted: 0.7506575340838828
precision_macro: 0.7150911360799
precision_micro: 0.7492063492063492
precision_weighted: 0.7534924677486475
recall_macro: 0.7595969666757304
recall_micro: 0.7492063492063492
recall_weighted: 0.7492063492063492
accuracy: 0.7492063492063492
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mserloth/v23")