Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
- fill-mask
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- legal
|
| 10 |
+
- pretraining
|
| 11 |
+
- cpt
|
| 12 |
+
- continued-pretraining
|
| 13 |
+
- legal-nlp
|
| 14 |
+
- law
|
| 15 |
+
size_categories:
|
| 16 |
+
- 1K<n<10K
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Legal Document Chunks for Continued Pretraining
|
| 20 |
+
|
| 21 |
+
This dataset contains **1281 legal document chunks** extracted from various legal documents across multiple jurisdictions. Each chunk is enriched with comprehensive metadata labels for filtering, analysis, and domain-specific training.
|
| 22 |
+
|
| 23 |
+
## Dataset Information
|
| 24 |
+
|
| 25 |
+
- **Total Chunks**: 1,281
|
| 26 |
+
- **Format**: jsonl-text
|
| 27 |
+
- **Sorted**: By document ID and chunk index (maintains document continuity)
|
| 28 |
+
- **Source**: Legal documents processed through enhanced parser with OCR support
|
| 29 |
+
- **Jurisdictions**: uk, us
|
| 30 |
+
- **Practice Areas**: 3 areas (Legal Theory, contract law, employment law...)
|
| 31 |
+
- **Document Types**: educational
|
| 32 |
+
- **Difficulty Levels**: advanced, basic, foundational, intermediate
|
| 33 |
+
|
| 34 |
+
## Metadata Labels
|
| 35 |
+
|
| 36 |
+
Each chunk includes the following labels:
|
| 37 |
+
|
| 38 |
+
| Field | Description | Example Values |
|
| 39 |
+
|-------|-------------|----------------|
|
| 40 |
+
| `chunk_number` | Sequential order (1-1281) | 1, 2, 3... |
|
| 41 |
+
| `document_chunk_index` | Position within source document | 0, 1, 2... |
|
| 42 |
+
| `document_id` | Unique document identifier | UUID |
|
| 43 |
+
| `document_title` | Document name | "basic laws book 2016" |
|
| 44 |
+
| `jurisdiction` | Legal jurisdiction | uk, us, eu, international |
|
| 45 |
+
| `practice_area` | Legal domain | employment law, contract law |
|
| 46 |
+
| `document_type` | Document classification | educational, case law, statute |
|
| 47 |
+
| `topic` | Specific legal topic | "Employment Law - Discrimination" |
|
| 48 |
+
| `sample_type` | Content structure type | statutory_interpretation, case_analysis |
|
| 49 |
+
| `difficulty` | Complexity level | basic, intermediate, advanced, expert |
|
| 50 |
+
| `classification_confidence` | Auto-classification confidence | 0.0 - 1.0 |
|
| 51 |
+
| `original_filename` | Source file name | "basic-laws-book-2016.pdf" |
|
| 52 |
+
|
| 53 |
+
## Format Details
|
| 54 |
+
|
| 55 |
+
**JSONL Text Format**: Each line contains a JSON object with a `text` field (formatted content) and `meta` field (structured labels). Compatible with HuggingFace datasets, Axolotl, Unsloth, and other training frameworks.
|
| 56 |
+
|
| 57 |
+
## Intended Use
|
| 58 |
+
|
| 59 |
+
This dataset is designed for:
|
| 60 |
+
- **Continued Pretraining (CPT)**: Domain adaptation for legal language models
|
| 61 |
+
- **Legal NLP Research**: Training and evaluating legal text understanding models
|
| 62 |
+
- **Domain Transfer Learning**: Fine-tuning general models for legal applications
|
| 63 |
+
- **Legal AI Development**: Building specialized legal assistance systems
|
| 64 |
+
|
| 65 |
+
## Example Usage
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
from datasets import load_dataset
|
| 69 |
+
|
| 70 |
+
# Load the full dataset
|
| 71 |
+
dataset = load_dataset("YOUR_USERNAME/legal-chunks-pretraining")
|
| 72 |
+
|
| 73 |
+
# Filter by jurisdiction
|
| 74 |
+
uk_chunks = dataset.filter(lambda x: x['jurisdiction'] == 'uk')
|
| 75 |
+
|
| 76 |
+
# Filter by difficulty
|
| 77 |
+
advanced_chunks = dataset.filter(lambda x: x['difficulty'] == 'advanced')
|
| 78 |
+
|
| 79 |
+
# Filter by practice area
|
| 80 |
+
employment_chunks = dataset.filter(lambda x: x['practice_area'] == 'employment law')
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Data Quality
|
| 84 |
+
|
| 85 |
+
- ✅ **Ordered**: Chunks are sorted by document ID and index for coherent reading
|
| 86 |
+
- ✅ **Classified**: Automatic classification with confidence scores
|
| 87 |
+
- ✅ **Diverse**: Multiple jurisdictions, practice areas, and difficulty levels
|
| 88 |
+
- ✅ **Rich Metadata**: 12+ labels per chunk for advanced filtering
|
| 89 |
+
- ✅ **OCR Support**: Enhanced parsing for scanned documents
|
| 90 |
+
|
| 91 |
+
## Dataset Statistics
|
| 92 |
+
|
| 93 |
+
- **Documents**: 13 unique source documents
|
| 94 |
+
- **Average Chunk Length**: ~956 characters
|
| 95 |
+
- **Jurisdictions**: 2 (uk, us)
|
| 96 |
+
- **Practice Areas**: 3 legal domains
|
| 97 |
+
- **Difficulty Distribution**: advanced, basic, foundational, intermediate
|
| 98 |
+
|
| 99 |
+
## Citation
|
| 100 |
+
|
| 101 |
+
Generated using the Global Legal AI Training Platform with enhanced document processing and automatic classification.
|
| 102 |
+
|
| 103 |
+
**Platform Features**:
|
| 104 |
+
- OCR-enhanced PDF parsing with PyMuPDF + EasyOCR
|
| 105 |
+
- GPU-accelerated classification (MPS/CUDA support)
|
| 106 |
+
- Quantized INT8 inference for efficient labeling
|
| 107 |
+
- Multi-jurisdiction legal domain classification
|
| 108 |
+
|
| 109 |
+
## License
|
| 110 |
+
|
| 111 |
+
Apache 2.0
|
| 112 |
+
|
| 113 |
+
## Acknowledgments
|
| 114 |
+
|
| 115 |
+
This dataset was created using advanced NLP techniques for legal document processing, including:
|
| 116 |
+
- Zero-shot classification for practice area detection
|
| 117 |
+
- Difficulty estimation based on text complexity
|
| 118 |
+
- Topic extraction using legal domain models
|