Homework2-llm / README.md
RooLeX's picture
Update README.md
5dcdd30 verified
|
Raw
History Blame Contribute Delete
7.13 kB
---
language:
- ru
pretty_name: "Russian Toxicity Detection Dataset"
tags:
- binary-classification
- toxicity
- russian
license: "mit"
task_categories:
- text-classification
dataset_info:
features:
- name: text
dtype: string
- name: label
dtype: int64
- name: __index_level_0__
dtype: int64
splits:
- name: train
num_bytes: 10023373
num_examples: 59451
- name: validation
num_bytes: 1247775
num_examples: 7431
- name: test
num_bytes: 1236186
num_examples: 7432
download_size: 6940945
dataset_size: 12507334
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: validation
path: data/validation-*
- split: test
path: data/test-*
---
# Dataset Card for Russian Toxicity Detection Dataset
## Dataset Details
### Dataset Description
This dataset is designed for **binary classification of toxic and non-toxic Russian texts**. It was created as part of an educational project to build a real-time quality control system for customer support messages. The goal is to automatically distinguish messages containing rudeness, sarcasm, or aggression (toxic) from neutral, polite, or informative messages (non-toxic).
- **Curated by:** RooLeX
- **Language(s):** Russian (ru)
- **License:** MIT License
### Dataset Sources
- **Repository:** https://huggingface.co/datasets/RooLeX/Homework2-llm
## Uses
### Direct Use
This dataset is intended for training and evaluating binary text classification models that detect toxicity in Russian-language texts. It can be used in content moderation systems, customer support quality control, social media monitoring, and similar applications.
### Out-of-Scope Use
- The dataset is not suitable for detecting toxicity in languages other than Russian.
- It should not be used to make automated decisions about individuals without human oversight.
- The dataset is balanced (equal number of toxic and non-toxic examples), which may not reflect real-world class distributions. Models trained on it may require threshold tuning for production use.
## Dataset Structure
### Data Fields
- **`text`** (`string`): The text content of the message.
- **`label`** (`int`): Binary label indicating toxicity (0 = non-toxic, 1 = toxic).
### Data Splits
The dataset is split into three subsets:
| Split | Number of Examples |
|-------------|-------------------|
| Train | 59,451 |
| Validation | 7,431 |
| Test | 7,432 |
All splits are balanced (approximately equal number of toxic and non-toxic samples).
## Dataset Creation
### Curation Rationale
The dataset was created to address the problem of automatically detecting toxic messages in customer support communications. Toxic messages can cause significant reputational damage, and the goal is to build a fast, accurate model that can flag or block such messages before they are sent to clients.
### Source Data
**Toxic class (label = 1)** was collected from publicly available datasets containing toxic Russian comments:
- [AlexSham/Toxic_Russian_Comments](https://huggingface.co/datasets/AlexSham/Toxic_Russian_Comments) — comments from the social network ok.ru
- [NiGuLa/Russian_Inappropriate_Messages](https://huggingface.co/datasets/NiGuLa/Russian_Inappropriate_Messages) — inappropriate/rude messages
- [textdetox/multilingual_toxicity_dataset](https://huggingface.co/datasets/textdetox/multilingual_toxicity_dataset) — multilingual toxicity data (Russian subset)
**Non-toxic class (label = 0)** was sourced from various Russian-language datasets that are unlikely to contain toxic content:
- [SetFit/amazon_massive_intent_ru-RU](https://huggingface.co/datasets/SetFit/amazon_massive_intent_ru-RU) — voice assistant commands
- [DeepPavlov/mtop_intent_ru](https://huggingface.co/datasets/DeepPavlov/mtop_intent_ru) — user queries and intents
- [MTS-AI-SearchSkill/MTSBerquad](https://huggingface.co/datasets/MTS-AI-SearchSkill/MTSBerquad) — question-answer pairs (QA)
- [mteb/ru_nlu_intent](https://huggingface.co/datasets/mteb/ru_nlu_intent) — intent classification texts
#### Data Collection and Processing
1. All source datasets were loaded using the Hugging Face `datasets` library.
2. For toxic sources, only examples labeled as toxic (or inappropriate) were selected.
3. For non-toxic sources, all examples were taken (with label 0).
4. The combined data was cleaned:
- Empty strings and NaN values were removed.
- Exact duplicate texts were dropped.
- Texts with less than 3 words or more than 500 words were filtered out.
5. Classes were balanced using undersampling of the larger class.
6. The balanced dataset was split into train/validation/test sets in 80/10/10 proportion with stratification to preserve class balance.
### Annotations
The dataset contains no additional annotations beyond the original labels from the source datasets. All labels are binary (toxic/non-toxic).
#### Personal and Sensitive Information
The dataset consists of text snippets from public sources and does not contain personally identifiable information (PII) such as names, addresses, phone numbers, etc. However, some toxic comments may contain offensive language.
## Bias, Risks, and Limitations
### Known Biases
- **Domain bias:** Toxic examples are predominantly from social media (ok.ru), while non-toxic examples come from voice assistants, QA systems, and intent data. This may cause the model to perform differently on texts from other domains (e.g., news, forums, email).
- **Cultural bias:** The data reflects the cultural and linguistic nuances of Russian-language internet communication, which may not generalize to other languages or regions.
- **Labeling bias:** The source datasets use different definitions of toxicity/inappropriateness, which may introduce inconsistencies.
- **Balance bias:** The dataset is artificially balanced, which does not reflect real-world toxicity prevalence.
### Risks
- The model may produce false positives (flagging harmless messages as toxic) or false negatives (missing genuine toxicity), which can have business consequences.
- The model may be sensitive to sarcasm, irony, or context, which are hard to capture in short texts.
### Recommendations
- Users should evaluate the model on domain-specific data before deployment.
- A human-in-the-loop review process is recommended for production use.
- The classification threshold should be tuned based on business priorities (e.g., lower threshold for stricter moderation).
### Dataset Card Authors
RooLeX
### Dataset Card Contact
- Hugging Face: [RooLeX](https://huggingface.co/RooLeX)
### Glossary
- Toxicity: Text that contains insults, threats, aggression, or rude language.
- Binary classification: A classification task with two possible outcomes (toxic vs. non-toxic).
## Citation
**BibTeX:**
```bibtex
@misc{russian_toxicity_dataset,
author = {RooLeX},
title = {Russian Toxicity Detection Dataset},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/RooLeX/Homework2-llm}
}