surrey-nlp/Cyberbullying-Detection-CB2
Cyberbullying Detection — CB2 Dataset Description CB2 is a relational, conversation-level cyberbullying detection dataset. Unlike single-post datasets, each instance in CB2 represents a pair of users and their full message exchange. The cyberbullying label is determined at the conversation level (i.e., whether the interaction between two users constitutes cyberbullying), enriched with demographic information, social closeness (peerness), and message-level… See the full description on the dataset page: https://huggingface.co/datasets/surrey-nlp/Cyberbullying-Detection-CB2.
Cyberbullying Detection — CB2
Dataset Description
CB2 is a relational, conversation-level cyberbullying detection dataset. Unlike single-post datasets, each instance in CB2 represents a pair of users and their full message exchange. The cyberbullying label is determined at the conversation level (i.e., whether the interaction between two users constitutes cyberbullying), enriched with demographic information, social closeness (peerness), and message-level aggression statistics.
The dataset was constructed from a school-age online communication study involving students aged 8–17 across 15 anonymised schools.
This dataset is part of the Cyberbullying-Detection collection on Hugging Face.
Dataset Structure
Data Fields
Label Classes
Source Files
CB2 was assembled from 6 source files:
Dataset Splits
The dataset is split as follows:
Split Methodology
from sklearn.model_selection import train_test_split
# Step 1: 75% train, 25% test+dev (stratified on label)
train_df, test_dev_df = train_test_split(df, test_size=0.25, random_state=42, stratify=df["label"])
# Step 2: 2000 rows for dev, rest for test
dev_df = test_dev_df.sample(n=2000, random_state=42)
test_df = test_dev_df.drop(dev_df.index)Usage
from datasets import load_dataset
dataset = load_dataset("Washii/Cyberbullying-Detection-CB2")
# Access splits
train = dataset["train"]
validation = dataset["validation"]
test = dataset["test"]
# Example row
print(train[0])
# {
# 'user1_id': 1, 'user2_id': 2,
# 'user1_age': 11, 'user1_gender': 'Others', 'user1_grade': 5,
# 'user2_age': 15, 'user2_gender': 'Male', 'user2_grade': 9,
# 'total_messages': 36, 'aggressive_count': 23,
# 'intent_to_harm': 0.769, 'peerness': 0.5,
# 'conversation': [
# {'message': 'bye bye dear bajaj...', 'label': 1},
# {'message': 'Article updated', 'label': 0},
# ...
# ],
# 'label': 1
# }Construction Notes
- The
conversationfield is built by grouping all messages in5. Communication_Data_Among_Users.csvby(User1 ID, User2 ID), sorted byDateandTime, and stored as a list of{message, label}dicts. - The
peernessfield in the final table comes directly from6. CB_Labels.csv(which already incorporates values from2. peerness_values.csv). - User demographics are joined twice (once for User 1, once for User 2) from
1. users_data.csv. - Files
3. Aggressive_All.csvand4. Non_Aggressive_All.csvare reference corpora and are not directly joined into the final table (their content is already represented via file 5).
Source Data
The original data is sourced from https://data.mendeley.com/datasets/wmx9jj2htd/2 (A Comprehensive Dataset for Automated Cyberbullying Detection)
Citation
If you use this dataset, please cite the original source appropriately.
Dataset Card Authors
Uploaded and curated by Washii.
