Text Classification
Transformers
Safetensors
English
modernbert
fill-mask
emotion
emotion-classification
multi-label
goemotions
text-embeddings-inference
Instructions to use CobuildX-AI/cbx-emotion-classifier-17M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CobuildX-AI/cbx-emotion-classifier-17M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="CobuildX-AI/cbx-emotion-classifier-17M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("CobuildX-AI/cbx-emotion-classifier-17M") model = AutoModelForMaskedLM.from_pretrained("CobuildX-AI/cbx-emotion-classifier-17M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 857 Bytes
02d8c71 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Copyright 2026 Cobuild Tech Private Limited
# SPDX-License-Identifier: Apache-2.0
"""Run from the model folder: python example.py (every text below is invented for this example)"""
from cbx_emotion import EmotionClassifier
clf = EmotionClassifier(".")
texts = [
"Thank you so much, this made my whole week!",
"I can't believe they cancelled the show after one season. Ugh.",
"The meeting has been moved to 3 pm on Thursday.",
"Wait, you're telling me he actually won? Wow.",
"I miss my grandmother every single day.",
"That guy cut the whole queue and then yelled at the cashier. Disgusting behaviour.",
"I'm really nervous about my exam results tomorrow.",
]
for text, r in zip(texts, clf.classify(texts)):
tags = ', '.join(f"{l} {r['scores'][l]:.2f}" for l in r['labels']) or '(none)'
print(f"{tags:<28} {text}")
|