Aminrhmni's picture
Update README.md
d2d218a verified
|
raw
history blame
No virus
1.99 kB
---
license: mit
language:
- fa
metrics:
- accuracy
library_name: adapter-transformers
datasets:
- Msobhi/virgool_62k
pipeline_tag: text-classification
---
Hi
I have fine-tuned ParsBert for classifying Persian text using the "Msobhi/virgool_62k" dataset, with the labels listed below:
{'استارتاپ': 0,
'اقتصاد': 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}
Utilize this code snippet to test the model. It may not be very accurate, but further training epochs could enhance its performance.
model_path = "Aminrhmni/Persian-text-classification-model"
from transformers import pipeline, BertForSequenceClassification, BertTokenizerFast
model = BertForSequenceClassification.from_pretrained(model_path)
tokenizer= BertTokenizerFast.from_pretrained(model_path)
nlp= pipeline("text-classification", model=model, tokenizer=tokenizer)
nlp("متن ورودی")