Downloads · 30 days
103
1% of all-time downloads
nanelimon/bert-base-turkish-offensive
bert-base-turkish-offensive is a text classification model from nanelimon. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is designed for text classification, specifically for identifying offensive content in Turkish text. The model classifies text into five categories: INSULT, OTHER, PROFANITY, RACIST, and SEXIST.
Downloads · 30 days
103
1% of all-time downloads
All-time downloads
13.8K
Public
Parameters
184M
737 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors737 MB · 100%
From the Hugging Face model README
This model is designed for text classification, specifically for identifying offensive content in Turkish text. The model classifies text into five categories: INSULT, OTHER, PROFANITY, RACIST, and SEXIST.
| INSULT | OTHER | PROFANITY | RACIST | SEXIST | |
|---|---|---|---|---|---|
| Precision | 0.901 | 0.924 | 0.978 | 1.000 | 0.980 |
| Recall | 0.920 | 0.980 | 0.900 | 0.980 | 1.000 |
| F1 Score | 0.910 | 0.9514 | 0.937 | 0.989 | 0.990 |
pip install torch torchvision torchaudio
pip install tf-keras
pip install transformers
pip install tensorflow
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification, TextClassificationPipeline
# Load the tokenizer and model
model_name = "nanelimon/bert-base-turkish-offensive"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
# Create the pipeline
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True, top_k=2)
# Test the pipeline
print(pipe('Bu bir denemedir hadi sende dene!'))
Result;
[[{'label': 'OTHER', 'score': 1.000}, {'label': 'INSULT', 'score': 0.000}]]
gpl-3.0
Free Software, Hell Yeah!