Instructions to use sofyanwaldy/indobert-beauty-spam-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sofyanwaldy/indobert-beauty-spam-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sofyanwaldy/indobert-beauty-spam-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("sofyanwaldy/indobert-beauty-spam-classifier") model = AutoModelForSequenceClassification.from_pretrained("sofyanwaldy/indobert-beauty-spam-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
indobert-beauty-spam-classifier
A fine-tuned IndoBERT model for detecting spam in Indonesian-language beauty product reviews.
Model Details
- Base model: indolem/indobert-base-uncased
- Architecture: BertForSequenceClassification (12 layers, hidden size 768, 12 attention heads)
- Language: Indonesian (id)
- Task: Binary text classification (spam detection)
- Labels:
0: Not Spam1: Spam
Intended Use
Classifies whether a beauty product review written in Indonesian is spam (promotional links, unrelated content, bot-like text) or a genuine review. Built for filtering user-generated review content on a beauty e-commerce platform.
Not intended for: languages other than Indonesian, review content outside the beauty/cosmetics domain, or as a sole moderation decision-maker in production without human review (see Limitations).
How to Use
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "sofyanwaldy/indobert-beauty-spam-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "Dapatkan uang dengan cepat! Klik di sini untuk informasi lebih lanjut."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
logits = model(**inputs).logits
predicted_class = torch.argmax(logits, dim=-1).item()
print("Spam" if predicted_class == 1 else "Not Spam")
Training Data
Fine-tuned on a custom dataset of 260 labeled Indonesian beauty product reviews (spam_classification_dataset_bahasa.csv):
- 162 not-spam examples
- 98 spam examples
- 80/20 train/test split (seed=42)
Training Procedure
| Hyperparameter | Value |
|---|---|
| Epochs | 3 |
| Learning rate | 2e-5 |
| Batch size (train/eval) | 8 |
| Weight decay | 0.01 |
| Optimizer | AdamW (HF Trainer default) |
Trained with the Hugging Face Trainer API on top of indolem/indobert-base-uncased.
Evaluation
No evaluation metrics were logged during training. Precision/recall/F1 on a held-out set have not yet been computed for this checkpoint β treat performance as unverified until evaluated.
Limitations and Bias
- Very small training set (260 examples): high risk of overfitting and poor generalization to review styles/topics not represented in the data.
- Class imbalance (~62% not-spam / 38% spam): may bias the model toward predicting "Not Spam."
- Domain-specific: trained only on beauty product reviews; unlikely to generalize to other review domains.
- No formal evaluation metrics available for this checkpoint β accuracy/F1 unknown.
- Not tested for adversarial or obfuscated spam patterns (e.g., leetspeak, character substitution).
License
MIT, inherited from base model indolem/indobert-base-uncased.
- Downloads last month
- -
Model tree for sofyanwaldy/indobert-beauty-spam-classifier
Base model
indolem/indobert-base-uncased