Views
No views yet

pipeline:1from transformers import pipeline
2import torch
3
4# Load directly from Hugging Face Hub
5classifier = pipeline(
6 "text-classification",
7 model="javokhirraimov/uzbek_news_classifier",
8 tokenizer="javokhirraimov/uzbek_news_classifier",
9 device=0 if torch.cuda.is_available() else -1
10)
11
12
13## Training Progress
14
15Below is a snapshot of the model's training performance during fine-tuning:
16
17
18
19## How to Use
20
21You can easily load and use this model with the Transformers `pipeline`:
22
23```python
24from transformers import pipeline
25import torch
26
27# Load directly from Hugging Face Hub
28classifier = pipeline(
29 "text-classification",
30 model="javokhirraimov/uzbek_news_classifier",
31 tokenizer="javokhirraimov/uzbek_news_classifier",
32 device=0 if torch.cuda.is_available() else -1
33)
34
35# Test it
36result = classifier("Toshkentda yangi futbol stadioni qurilmoqda")
37print(f"Predicted: {result[0]['label']} (Confidence: {result[0]['score']:.2f})")
38
39
40Predicted: sport (Confidence: 0.99)