--- pretty_name: Urdu Hate Speech tags: - urdu - hate-speech - toxicity - text-classification - safety - moderation task_categories: - text-classification task_ids: - hate-speech-detection language: - ur license: mit annotations_creators: - expert-generated language_creators: - found multilinguality: - monolingual size_categories: - 10K`. - Stripped leading `RT` markers. - Content filtering: - Removed non-textual artifacts (e.g., leftover HTML entities). - Deduplicated messages. - Casing: - Urdu is caseless; original letter forms preserved. - Files: - `Urdu_Hate_Speech.xlsx`: cleaned, manually labeled tweets (`Tweet`, `Tag`). - `preprocessed_combined_file (1).xlsx`: combined/cleaned set used in modeling; same column schema (`Tweet`, `Tag`). Note: Additional balancing (e.g., TF–IDF + SMOTE) was applied only during model training, not as part of the released raw labels. ## Dataset Structure ### Data Files Included - `Urdu_Hate_Speech.xlsx` - `preprocessed_combined_file (1).xlsx` ### Data Fields - `Tweet` (string): the input text in Urdu. - `Tag` (int): class id in {0, 1} - 0: not_hate - 1: hate If you prefer canonical names, rename to: - `text` (string) - `label` (ClassLabel: not_hate/hate) ### Data Splits Splits are not fixed and can be defined at load time. Example mapping: - train: `preprocessed_combined_file (1).xlsx` - validation: `Urdu_Hate_Speech.xlsx` Adjust as needed. ## How to Use Install: ```bash pip install -U datasets # For Excel files: pip install -U "datasets[excel]" openpyxl ``` Load and (optionally) rename columns: ```python from datasets import load_dataset DATASET_ID = "Adnan855570/urdu-hate-speech" ds = load_dataset( DATASET_ID, data_files={ "train": "preprocessed_combined_file (1).xlsx", "validation": "Urdu_Hate_Speech.xlsx", }, # sheet="Sheet1", # uncomment if you need a specific Excel sheet ) # If your files use 'Tweet' and 'Tag', rename to canonical names: ds = ds.rename_columns({"Tweet": "text", "Tag": "label"}) # Cast label to ClassLabel with names from datasets import ClassLabel, Value, Features features = Features({ "text": Value("string"), "label": ClassLabel(names=["not_hate", "hate"]), }) ds = ds.cast(features) ``` Quick usage with Transformers: ```python from transformers import pipeline clf = pipeline("text-classification", model="Adnan855570/urdu-roberta-hate", top_k=None) ex = ds["train"][0]["text"] print(clf(ex)) ``` ## Ethical Considerations and Limitations - Context sensitivity: May misclassify satire, reclaimed slurs, or code-mixed content. - Bias: Labels may reflect annotator and platform biases. - Risk: False positives can suppress legitimate speech; false negatives can miss harmful content. - Recommendation: Use with human-in-the-loop; audit for disparate impact; calibrate decision thresholds. ## Licensing This dataset is released under the MIT License. ## Citation Please cite if you use this dataset. ```bibtex @misc{urdu_hate_speech_ds_2025, title = {Urdu Hate Speech Dataset}, author = {Adnan}, year = {2025}, howpublished = {\url{https://huggingface.co/datasets/Adnan855570/urdu-hate-speech}} } ``` ## Acknowledgements - Thanks to contributors and the Urdu NLP community.