Instructions to use ennp/bert-turkish-text-classification-cased with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ennp/bert-turkish-text-classification-cased with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ennp/bert-turkish-text-classification-cased")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ennp/bert-turkish-text-classification-cased") model = AutoModelForSequenceClassification.from_pretrained("ennp/bert-turkish-text-classification-cased") - Notebooks
- Google Colab
- Kaggle
Bu model https://github.com/stefan-it/turkish-bert'in; aşağıdaki 5 kategorinin olduğu metin sınıflandırma verilerine göre fine-tuned edilmiş halidir.
code_to_label={
'LABEL_0': 'INSULT ',
'LABEL_1': 'RACIST ',
'LABEL_2': 'SEXIST',
'LABEL_3': 'PROFANITY ',
'LABEL_4': 'OTHER' }
from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer, AutoModelForSequenceClassification
tokenizer= AutoTokenizer.from_pretrained("ennp/bert-turkish-text-classification-cased")
model= AutoModelForSequenceClassification.from_pretrained("ennp/bert-turkish-text-classification-cased")
nlp=pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
code_to_label={
'LABEL_0': 'INSULT ',
'LABEL_1': 'RACIST ',
'LABEL_2': 'SEXIST',
'LABEL_3': 'PROFANITY ',
'LABEL_4': 'OTHER' }
code_to_label[nlp("kıl herif gibi davranma")[0]['label']]
- Downloads last month
- 3