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
Download example.py from CobuildX-AI/cbx-emotion-classifier-17M: direct link, hf CLI and curl.
- Browser
- Download file 857 Bytes
-
https://huggingface.co/CobuildX-AI/cbx-emotion-classifier-17M/resolve/main/example.py
- Command line
-
hf download hf://CobuildX-AI/cbx-emotion-classifier-17M/example.py
-
curl -L -o example.py https://huggingface.co/CobuildX-AI/cbx-emotion-classifier-17M/resolve/main/example.py
857 Bytes
| # 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}") | |