Downloads · 30 days
15
3% of all-time downloads
BaranKanat/BerTurk-SpamSMS
BerTurk-SpamSMS is a text classification model from BaranKanat. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
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.
Downloads · 30 days
15
3% of all-time downloads
All-time downloads
569
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 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.
The model was trained using the BERTurk tokenizer and classifier with the following configuration:
dbmdz/bert-base-turkish-128k-uncasedThe dataset used includes both spam and normal SMS messages, ensuring balanced representation.
The model achieved the following metrics:
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.
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
This model is licensed under the CreativeML OpenRAIL-M license.
For more details, refer to the CreativeML OpenRAIL-M license terms.
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:
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.
Model, BERTurk tokenizer ve sınıflandırıcı kullanılarak şu yapılandırmayla eğitildi:
dbmdz/bert-base-turkish-128k-uncasedEğitim verisi, hem spam hem de normal SMS mesajlarını içeren dengeli bir veri seti kullanılarak hazırlanmıştır.
Model aşağıdaki metriklere ulaşmıştır:
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:
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
Bu model, CreativeML OpenRAIL-M lisansı ile lisanslanmıştır.
Daha fazla bilgi için CreativeML OpenRAIL-M lisans şartlarını inceleyebilirsiniz.
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})")