Views
No views yet
| ID | Category | Examples |
|---|---|---|
| 0 | politics | Elections, Government, Parliament, Modi, BJP |
| 1 | sports | Cricket, IPL, Football, Olympics |
| 2 | business | Sensex, RBI, Stock Market, Economy |
| 3 | technology | iPhone, AI, Gadgets, Software |
| 4 | entertainment | Bollywood, Movies, Celebrities |
| 5 | international | World News, USA, China, War |
pip install transformers torch1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="dev-isure/new-clasification-manish"
6)
7
8# English news
9result = classifier("Virat Kohli scores century in IPL match")
10print(result)
11# [{'label': 'sports', 'score': 0.95}]
12
13# Hindi news
14result = classifier("सेंसेक्स 500 अंक गिरा, बाजार में भारी बिकवाली")
15print(result)
16# [{'label': 'business', 'score': 0.91}]1news = [
2 "PM Modi inaugurates new expressway in UP",
3 "India beats Australia in T20 series",
4 "RBI keeps repo rate unchanged at 6.5%",
5 "Apple launches new iPhone 17 Pro",
6 "Shah Rukh Khan's new film breaks box office records",
7 "Russia Ukraine war ceasefire talks begin"
8]
9
10results = classifier(news)
11for text, res in zip(news, results):
12 print(f"{res['label']:<15} ({res['score']:.2f}) {text[:50]}")| Detail | Value |
|---|---|
| Base Model | distilbert-base-multilingual-cased |
| Training Articles | 792 |
| Validation Articles | 99 |
| Test Articles | 100 |
| Epochs | 3 |
| Batch Size | 8 |
| Learning Rate | 2e-5 |
| Test Accuracy | 78% |