| --- |
| language: |
| - tr |
| tags: |
| - turkish |
| - content-moderation |
| - text-classification |
| - xlm-roberta |
| - moderation |
| license: mit |
| datasets: |
| - self-created |
| base_model: xlm-roberta-large |
| metrics: |
| - accuracy |
| - f1 |
| pipeline_tag: text-classification |
| model-index: |
| - name: turkish-content-moderation |
| results: |
| - task: |
| type: text-classification |
| name: Text Classification |
| dataset: |
| type: self-created |
| name: Turkish Content Moderation Dataset |
| metrics: |
| - type: accuracy |
| value: 83.0 |
| name: Accuracy |
| - type: f1 |
| value: 82.5 |
| name: Macro F1 |
| --- |
| |
| # Turkish Content Moderation Model (Türkçe İçerik Moderasyonu) |
|
|
| XLM-RoBERTa-large tabanlı, Türkçe metinleri 7 kategoride sınıflandıran bir içerik moderasyon modelidir. |
|
|
| ## Kategoriler |
|
|
| | Index | Kategori | Açıklama | |
| |-------|----------|----------| |
| | 0 | normal | Normal, zararsız içerik | |
| | 1 | kufur | Küfür içeren ifadeler | |
| | 2 | tehdit | Tehdit edici ifadeler | |
| | 3 | taciz | Taciz içeren ifadeler | |
| | 4 | nefret | Nefret söylemi | |
| | 5 | saka/igneleme | Şaka veya iğneleme amaçlı ifadeler | |
| | 6 | cinsel | Cinsel içerikli ifadeler | |
|
|
| ## Performans |
|
|
| | Sınıf | F1 Skoru | |
| |-------|----------| |
| | Küfür | %94.7 | |
| | Normal | %85.7 | |
| | Cinsel | %85.7 | |
| | Nefret | %84.0 | |
| | Şaka/İğneleme | %83.8 | |
| | Tehdit | %80.9 | |
| | Taciz | %62.7 | |
| | **Macro F1** | **%82.5** | |
| | **Accuracy** | **%83.0** | |
|
|
| ## Dataset |
|
|
| Bu model, kendi oluşturulan Türkçe içerik moderasyon veri seti ile fine-tune edilmiştir. |
|
|
| ## Kullanım |
|
|
| ```python |
| import torch |
| from transformers import AutoModelForSequenceClassification, AutoTokenizer |
| |
| model_name = "cibi11/turkish-content-moderation" |
| tokenizer = AutoTokenizer.from_pretrained(model_name) |
| model = AutoModelForSequenceClassification.from_pretrained(model_name) |
| model.eval() |
| |
| text = "Seninle konuşmak istemiyorum" |
| inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128) |
| |
| with torch.no_grad(): |
| logits = model(**inputs).logits |
| probs = torch.softmax(logits, dim=-1)[0] |
| |
| kategoriler = ["normal", "kufur", "tehdit", "taciz", "nefret", "saka/igneleme", "cinsel"] |
| for label, prob in zip(kategoriler, probs): |
| print(f"{label}: %{prob.item() * 100:.1f}") |
| |
| print(f"Sonuç: {kategoriler[probs.argmax()]}") |
| ``` |
|
|
| ## Limitations |
|
|
| Bu model hatalı pozitif ve hatalı negatif sonuçlar üretebilir ve tek başına moderasyon kararları için yeterli değildir. Kullanım öncesinde insan denetimi önerilir. |
|
|
| ## License |
|
|
| MIT |
|
|
| ## Base Model |
|
|
| This model is fine-tuned from [xlm-roberta-large](https://huggingface.co/FacebookAI/xlm-roberta-large), which is released under the MIT License. |
|
|