Text Classification
Transformers
Safetensors
modernbert
fill-mask
sentiment-analysis
indic
multilingual
code-mixed
romanized
text-embeddings-inference
Instructions to use CobuildX-AI/cbx-indic-sentiment-classifier-36M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CobuildX-AI/cbx-indic-sentiment-classifier-36M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="CobuildX-AI/cbx-indic-sentiment-classifier-36M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("CobuildX-AI/cbx-indic-sentiment-classifier-36M") model = AutoModelForMaskedLM.from_pretrained("CobuildX-AI/cbx-indic-sentiment-classifier-36M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download example.py from CobuildX-AI/cbx-indic-sentiment-classifier-36M: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/CobuildX-AI/cbx-indic-sentiment-classifier-36M/resolve/main/example.py
- Command line
-
hf download hf://CobuildX-AI/cbx-indic-sentiment-classifier-36M/example.py
-
curl -L -o example.py https://huggingface.co/CobuildX-AI/cbx-indic-sentiment-classifier-36M/resolve/main/example.py
1.34 kB
| # 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_sentiment import SentimentClassifier | |
| clf = SentimentClassifier(".") | |
| texts = [ | |
| "Bahut badhiya phone hai, battery poora din chalti hai.", # romanized Hindi: great phone, the battery lasts all day | |
| "ডেলিভারি তিন দিন দেরিতে এসেছে, খুবই হতাশ।", # Bengali: delivery came three days late, very disappointed | |
| "நாளை காலை பத்து மணிக்கு கூட்டம் தொடங்கும்.", # Tamil: the meeting starts at ten tomorrow morning | |
| "ಈ ಸಿನಿಮಾ ತುಂಬಾ ಚೆನ್ನಾಗಿದೆ, ಎಲ್ಲರೂ ನೋಡಿ!", # Kannada: this film is very good, everyone watch it | |
| "सरकार ने नई योजना की घोषणा की है।", # Hindi: the government has announced a new scheme | |
| "yaar kya bakwaas movie thi, paisa barbaad", # romanized Hindi: what a rubbish film, money wasted | |
| "Service was okay but the food was cold and overpriced.", | |
| ] | |
| for text, r in zip(texts, clf.classify(texts)): | |
| print(f"{r['label']:<9} {max(r['scores'].values()):.2f} {text}") | |