Instructions to use QomSSLab/SubjectClassifier-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QomSSLab/SubjectClassifier-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="QomSSLab/SubjectClassifier-v1")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("QomSSLab/SubjectClassifier-v1") model = AutoModelForSequenceClassification.from_pretrained("QomSSLab/SubjectClassifier-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,407 Bytes
7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 a561934 7fe9ee8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ---
language: fa
pipeline_tag: text-classification
library_name: transformers
---
# QomSSLab/SubjectClassifier-v1
This repository hosts a sequence-classification head trained for text classification.
## Usage
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
model_id = "QomSSLab/SubjectClassifier-v1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
text = "مثال از یک ورودی فارسی"
print(classifier(text))
```
## Labels
- `اخلاق`
- `تاریخ`
- `حدیث`
- `سیاسی`
- `فقه و احکام`
- `قرآن`
- `مشاوره`
- `کلام و اعتقادات`
## Metrics
## Validation Metrics
- Precision: 0.9717
- Recall: 0.9713
- F1: 0.9713
- Accuracy: 0.9713
### Per-label Breakdown
| Label | Precision | Recall | F1 | Support |
| --- | --- | --- | --- | --- |
| اخلاق | 0.9455 | 0.9598 | 0.9526 | 199 |
| تاریخ | 0.9815 | 1.0000 | 0.9907 | 53 |
| حدیث | 0.9487 | 0.9823 | 0.9652 | 113 |
| سیاسی | 1.0000 | 0.9693 | 0.9844 | 163 |
| فقه و احکام | 0.9652 | 1.0000 | 0.9823 | 222 |
| قرآن | 1.0000 | 0.9875 | 0.9937 | 80 |
| مشاوره | 0.9670 | 0.9263 | 0.9462 | 95 |
| کلام و اعتقادات | 0.9818 | 0.9558 | 0.9686 | 226 |
|