Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Arabic Legal Dataset - Legal Text Classification

Dataset Description

Multi-label classification dataset for Arabic legal texts with hierarchical categories and metadata.

This dataset contains 1,046 examples of classification data derived from Egyptian legal texts, including criminal law, civil law, procedural law, and personal status law. The dataset is designed for training and evaluating Arabic legal AI models.

Dataset Summary

  • Language: Arabic (Egyptian Legal)
  • Domain: Legal texts and jurisprudence
  • Task: text-classification
  • Size: 1,046 examples (1.2 MB)
  • Source: Egyptian legal codes and statutes

Dataset Structure

Data Fields

  • text: Arabic legal text to classify
  • labels: List of applicable legal categories
  • features: Additional metadata and features
  • context: Contextual information about the text

Data Example

{
  "text": "المادة الأولى: يُعاقب بالحبس مدة لا تقل عن سنة ولا تزيد على ثلاث سنوات...",
  "labels": [
    "criminal_law",
    "punishment",
    "imprisonment"
  ],
  "features": {
    "complexity": "high",
    "stakeholders": [
      "defendant",
      "court"
    ]
  },
  "context": {
    "law_code": "penal",
    "article_number": "1"
  }
}

Data Statistics

Statistic Value
Total Examples 1,046
Average Text Length 281 characters
Vocabulary Size ~7,222 unique terms
Dataset Size 1.2 MB

Legal Domain Coverage

This dataset covers the following areas of Egyptian law: Criminal Law, Labor Law, Civil Law, Administrative Law.

Usage

Loading the Dataset

from datasets import load_dataset

dataset = load_dataset("fr3on/eg-legal-classification")

# Print basic info
print(f"Number of examples: {len(dataset['train'])}")
print(f"Features: {dataset['train'].features}")

# View first example
print(dataset['train'][0])

Example Use Cases

  • Training legal document classification models
  • Automated categorization of legal texts
  • Building legal search and filtering systems
  • Developing legal analytics tools

Dataset Creation

Source Data

This dataset was created from Egyptian legal texts including:

  • Criminal Procedure Law (قانون الإجراءات الجنائية) - 498 articles
  • Personal Status Law (قانون الأحوال الشخصية) - 51 articles
  • Penal Code (قانون العقوبات) - 497 articles

Data Processing

  1. Text Extraction: Legal articles extracted from official JSON sources
  2. Structure Parsing: Hierarchical legal structure preserved
  3. Schema Conversion: Converted to classification format
  4. Quality Control: Validated for consistency and proper Arabic encoding

Considerations for Use

Intended Use

This dataset is intended for:

  • Research in Arabic natural language processing
  • Training legal AI models for Arabic text
  • Educational purposes in computational linguistics
  • Development of legal technology applications

Limitations

  • Contains only Egyptian legal texts (may not generalize to other Arabic legal systems)
  • Reflects the specific legal framework and language of Egyptian law
  • Should not be used as a substitute for professional legal advice
  • May contain biases present in the original legal texts

Citation

@dataset{arabic_legal_classification_2025,
  title={Arabic Legal Dataset - Legal Text Classification},
  author={fr3on},
  year={2025},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/fr3on/eg-legal-classification}
}

License

This dataset is released under the Apache 2.0 License. The original legal texts are public domain.

Acknowledgments

Created by fr3on as part of efforts to advance Arabic legal AI research.

Downloads last month
24