Spam SMS Detection Model

This model is fine-tuned from dbmdz/bert-base-turkish-128k-uncased for SMS spam detection in Turkish. It is designed to classify text messages as either Spam or Normal.

Training

The model was trained using the BERTurk tokenizer and classifier with the following configuration:

  • Model: dbmdz/bert-base-turkish-128k-uncased
  • Optimizer: AdamW
  • Learning rate: 5e-5
  • Epochs: 4

The dataset used includes both spam and normal SMS messages, ensuring balanced representation.

Performance

The model achieved the following metrics:

  • Accuracy: Will be updated after testing on more datasets.
  • F1-Score: Will be updated after testing on more datasets.
  • Precision: Will be updated after testing on more datasets.
  • Recall: Will be updated after testing on more datasets.

Dataset

The dataset used for fine-tuning is the Turkish SMS Collection Dataset, which is publicly available on Kaggle. It contains 2,536 spam messages and 2,215 normal (ham) messages.

About the Dataset

The dataset is a collection of Turkish SMS messages tagged as spam or normal. It was collected from people of different age groups living in different regions of Turkey.

If you use this dataset, please cite: Karasoy, O., Ballı, S. Spam SMS Detection for Turkish Language with Deep Text Analysis and Deep Learning Methods. Arab J Sci Eng (2021). https://doi.org/10.1007/s13369-021-06187-1

License

This model is licensed under the CreativeML OpenRAIL-M license.

  • Allowed: You can use, share, and modify the model for non-commercial purposes, as long as proper attribution is given.
  • Not Allowed: Commercial use or selling this model or its derivatives is strictly prohibited.

For more details, refer to the CreativeML OpenRAIL-M license terms.

Usage

You can use this model with the Hugging Face Transformers library:

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name = "BaranKanat/BerTurk-SpamSMS"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

test_sms = "2000 TL DENEME BONUSU KAZANDINIZ !!! YATIRIM SARTI YOK KAZANC ve CEKIM LIMITI YOK." #SPAM SMS

inputs = tokenizer(test_sms, return_tensors="pt", truncation=True, padding=True)

with torch.no_grad():
    outputs = model(**inputs)

logits = outputs.logits
predicted_class = torch.argmax(logits, dim=1).item()

labels = ["Normal", "Spam"]  # 0: Normal, 1: Spam
print(f"Mesaj: {test_sms}")
print(f"Sonuç: {labels[predicted_class]} ({predicted_class})")

tags: - text-classification - spam-detection license: apache-2.0

------------------------ Türkçe ------------------------

Spam SMS Tespit Modeli

Bu model, dbmdz/bert-base-turkish-128k-uncased tabanlı olarak Türkçe SMS'lerde spam tespiti için özelleştirilmiştir. Model, SMS mesajlarını Spam veya Normal olarak sınıflandırmak için tasarlanmıştır.

Eğitim

Model, BERTurk tokenizer ve sınıflandırıcı kullanılarak şu yapılandırmayla eğitildi:

  • Model: dbmdz/bert-base-turkish-128k-uncased
  • Optimizatör: AdamW
  • Öğrenme oranı: 5e-5
  • Dönem sayısı (Epochs): 4

Eğitim verisi, hem spam hem de normal SMS mesajlarını içeren dengeli bir veri seti kullanılarak hazırlanmıştır.

Performans

Model aşağıdaki metriklere ulaşmıştır:

  • Doğruluk (Accuracy): Daha fazla veri setinde test edildikten sonra güncellenecektir.
  • F1-Skoru: Daha fazla veri setinde test edildikten sonra güncellenecektir.
  • Kesinlik (Precision): Daha fazla veri setinde test edildikten sonra güncellenecektir.
  • Duyarlılık (Recall): Daha fazla veri setinde test edildikten sonra güncellenecektir.

Veri Seti

Modelin eğitimi için kullanılan veri seti, Turkish SMS Collection Dataset adında bir veri setidir ve Kaggle üzerinde herkese açık bir şekilde mevcuttur. Veri seti şu mesajları içermektedir:

  • 2.536 spam mesaj
  • 2.215 normal mesaj

Veri Seti Hakkında

Bu veri seti, spam veya normal olarak etiketlenmiş Türkçe SMS mesajlarından oluşmaktadır. Türkiye'nin farklı bölgelerinde yaşayan çeşitli yaş gruplarındaki insanlardan toplanmıştır.

Eğer bu veri setini kullanırsanız, lütfen aşağıdaki makaleyi referans gösterin: Karasoy, O., Ballı, S. Türkçe Dilinde Derin Metin Analizi ve Derin Öğrenme Yöntemleri ile Spam SMS Tespiti. Arab J Sci Eng (2021). https://doi.org/10.1007/s13369-021-06187-1

Lisans

Bu model, CreativeML OpenRAIL-M lisansı ile lisanslanmıştır.

  • İzin Verilenler: Modeli, uygun atıf sağlandığı sürece ticari olmayan amaçlarla kullanabilir, paylaşabilir ve değiştirebilirsiniz.
  • İzin Verilmeyenler: Modelin veya türevlerinin ticari amaçlarla kullanılması veya satılması kesinlikle yasaktır.

Daha fazla bilgi için CreativeML OpenRAIL-M lisans şartlarını inceleyebilirsiniz.

Kullanım

Bu modeli Hugging Face Transformers kütüphanesi ile şu şekilde kullanabilirsiniz:

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name = "BaranKanat/BerTurk-SpamSMS"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

test_sms = "2000 TL DENEME BONUSU KAZANDINIZ !!! YATIRIM SARTI YOK KAZANC ve CEKIM LIMITI YOK." #SPAM SMS

inputs = tokenizer(test_sms, return_tensors="pt", truncation=True, padding=True)

with torch.no_grad():
    outputs = model(**inputs)

logits = outputs.logits
predicted_class = torch.argmax(logits, dim=1).item()

labels = ["Normal", "Spam"]  # 0: Normal, 1: Spam
print(f"Mesaj: {test_sms}")
print(f"Sonuç: {labels[predicted_class]} ({predicted_class})")
Downloads last month
87
Safetensors
Model size
184M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the model is not deployed on the HF Inference API.