Instructions to use Rbooii/CyberBully-Detection-indoBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rbooii/CyberBully-Detection-indoBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Rbooii/CyberBully-Detection-indoBERT")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Rbooii/CyberBully-Detection-indoBERT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
CyberBully Detection β IndoBERT A and B2
Two binary text-classification checkpoints for Indonesian social-media text:
a/β IndoBERT fine-tuned on real data only (10,397 training rows).b2/β IndoBERT fine-tuned on real data plus 20,000 synthetic examples (30,397 training rows).
Labels:
0= non-bully1= bully
Base model: indobenchmark/indobert-base-p1.
The task is a research benchmark for cyberbullying-related text. The original dataset labels hate speech and abusive language; this is not a complete definition of cyberbullying.
Files
a/
config.json
model.safetensors
tokenizer_config.json
tokenizer.json
threshold.json
run_meta.json
b2/
config.json
model.safetensors
tokenizer_config.json
tokenizer.json
threshold.json
run_meta.json
README.md
No raw tweets, prediction CSVs, or training pickles are included.
Thresholds
threshold.json stores the selected decision threshold and validation metrics. from_pretrained does not read this file automatically; load it separately.
| Checkpoint | Subfolder | Threshold |
|---|---|---|
| A, real-only | a |
0.42 |
| B2, real + synthetic | b2 |
0.50 |
Metrics
Validation and test splits contain 1,300 rows each. The manual evaluation set contains 40 reviewed rows; 10 additional rows are still proposals and are excluded. The evaluation set was not used for training or threshold selection.
| Checkpoint | Split | Threshold | Accuracy | Precision (bully) | Recall (bully) | F1 (bully) |
|---|---|---|---|---|---|---|
| A | validation | 0.42 | 0.922 | 0.933 | 0.925 | 0.929 |
| B2 | validation | 0.50 | 0.908 | 0.922 | 0.913 | 0.917 |
| A | test | 0.42 | 0.917 | 0.923 | 0.928 | 0.925 |
| B2 | test | 0.05 | 0.908 | 0.896 | 0.943 | 0.919 |
| A | manual eval (40) | 0.42 | 0.500 | 1.000 | 0.259 | 0.412 |
| B2 | manual eval (40) | 0.50 | 0.850 | 0.839 | 0.963 | 0.897 |
Important: B2 test was measured at threshold 0.05, before the threshold policy was fixed. The deployment threshold is 0.50, but B2 has not been re-evaluated on test at 0.50. Do not compare the B2 test row directly with A.
Category-level observations from the 40-row manual evaluation set:
- B2 is stronger on indirect praise, body shaming, sarcasm about work, innuendo, and subtweets.
- B2 produces more false positives on criticism and neutral text.
- A is conservative: high precision, low recall on indirect bullying.
- Gaslighting is not measured because all five gaslighting rows are still proposals.
- Several categories have only one reviewed row; their accuracy is unstable.
These results support a trade-off, not a claim that one model is universally better.
Usage
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
repo_id = "Rbooii/CyberBully-Detection-indoBERT"
subfolder = "b2" # use "a" for the real-only model
threshold = 0.50 # use 0.42 for "a"
tokenizer = AutoTokenizer.from_pretrained(repo_id, subfolder=subfolder)
model = AutoModelForSequenceClassification.from_pretrained(
repo_id,
subfolder=subfolder,
)
model.eval()
text = "Gitu aja baper, cuma bercanda kali. Main medsos kok sensitif amat"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probability_bully = torch.softmax(logits, dim=-1)[0, 1].item()
label = int(probability_bully >= threshold)
print({"label": label, "bully_probability": probability_bully})
Load the threshold file explicitly:
from huggingface_hub import hf_hub_download
threshold_path = hf_hub_download(
repo_id,
"b2/threshold.json",
)
Training
Both checkpoints use indobenchmark/indobert-base-p1 with 3 epochs, batch size 16, maximum length 128 tokens, learning rate 2e-5, class weights, and seed 42.
| Checkpoint | Training rows | Composition |
|---|---|---|
| A | 10,397 | real data only |
| B2 | 30,397 | 10,397 real + 20,000 synthetic |
The synthetic data contains 14,000 positive examples and 6,000 hard negatives. It is used only in training; validation, test, and the manual evaluation set contain real data. Synthetic examples were generated from templates and checked for duplicates, PII, URLs, and overlap with evaluation splits.
Intended use
Research, teaching, and demo purposes: comparing a real-only model with a model augmented using synthetic examples for non-explicit sarcasm and indirect bullying.
Limitations and ethical use
- Not an automatic punishment or moderation decision system. Human review is required.
- The model does not read conversation context, user relationships, or tone.
- False positives are possible on criticism, neutral conversation, and friendly roughhousing.
- Synthetic data is template-based; the model may learn generator patterns.
- The manual evaluation set is small (40 reviewed rows), and gaslighting is not measured.
- The original dataset is Indonesian Twitter data labelled for hate speech and abusive language, not a dedicated cyberbullying dataset.
- B2 test at the deployment threshold 0.50 has not been run.
- Results come from one split and seed; no confidence intervals or statistical tests are reported.
License and attribution
- Base model:
indobenchmark/indobert-base-p1, MIT license. - Dataset: Indonesian Abusive and Hate Speech Twitter Text by Ibrohim and Budi (2019), CC BY-NC-SA 4.0.
- Fine-tuned weights in this repository: CC BY-NC-SA 4.0. Attribution is required, commercial use is not permitted, and derivatives must use the same license.
- No raw dataset text or prediction files are redistributed here.
If you use this model, cite:
@inproceedings{ibrohim2019multi,
title = {Multi-label Hate Speech and Abusive Language Detection in Indonesian Twitter},
author = {Ibrohim, Muhammad Okky and Budi, Indra},
booktitle = {Proceedings of the Third Workshop on Abusive Language Online (ALW3)},
pages = {46--57},
year = {2019}
}
Project
Source code and report: https://github.com/Rbooii/CyberBully-Detection
Model tree for Rbooii/CyberBully-Detection-indoBERT
Base model
indobenchmark/indobert-base-p1