fr3on commited on
Commit
f6cc24b
·
verified ·
1 Parent(s): b1c667a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +162 -55
README.md CHANGED
@@ -1,57 +1,164 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: id
5
- dtype: string
6
- - name: text
7
- dtype: string
8
- - name: entities
9
- list:
10
- - name: confidence
11
- dtype: float64
12
- - name: end
13
- dtype: int64
14
- - name: id
15
- dtype: int64
16
- - name: label
17
- dtype: string
18
- - name: start
19
- dtype: int64
20
- - name: text
21
- dtype: string
22
- - name: relations
23
- list:
24
- - name: confidence
25
- dtype: float64
26
- - name: head
27
- dtype: string
28
- - name: relation
29
- dtype: string
30
- - name: tail
31
- dtype: string
32
- - name: legal_concepts
33
- list: string
34
- - name: metadata
35
- struct:
36
- - name: article_number
37
- dtype: string
38
- - name: document_title
39
- dtype: string
40
- - name: entity_density
41
- dtype: float64
42
- - name: hierarchy
43
- dtype: string
44
- - name: relation_density
45
- dtype: float64
46
- splits:
47
- - name: train
48
- num_bytes: 853274
49
- num_examples: 1046
50
- download_size: 245781
51
- dataset_size: 853274
52
- configs:
53
- - config_name: default
54
- data_files:
55
- - split: train
56
- path: data/train-*
57
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - token-classification
5
+ language:
6
+ - ar
7
+ tags:
8
+ - legal
9
+ - arabic
10
+ - egypt
11
+ - egyptian-law
12
+ - ner
13
+ - legal-entities
14
+ - token-classification
15
+ size_categories:
16
+ - 1K<n<10K
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  ---
18
+
19
+ # Arabic Legal Dataset - Legal Named Entity Recognition
20
+
21
+ ## Dataset Description
22
+
23
+ Named entity recognition dataset for Arabic legal texts with specialized legal entity types and relationships.
24
+
25
+ This dataset contains 1,046 examples of ner 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.
26
+
27
+ ### Dataset Summary
28
+
29
+ - **Language**: Arabic (Egyptian Legal)
30
+ - **Domain**: Legal texts and jurisprudence
31
+ - **Task**: token-classification
32
+ - **Size**: 1,046 examples (1.6 MB)
33
+ - **Source**: Egyptian legal codes and statutes
34
+
35
+ ## Dataset Structure
36
+
37
+ ### Data Fields
38
+
39
+ - **text**: Arabic legal text with entities
40
+ - **entities**: List of legal entities with positions and types
41
+ - **relations**: Relationships between entities
42
+ - **legal_concepts**: Associated legal concepts
43
+
44
+ ### Data Example
45
+
46
+ ```json
47
+ {
48
+ "text": "نصت محكمة النقض المصرية في الطعن رقم 123 لسنة 2023",
49
+ "entities": [
50
+ {
51
+ "text": "محكمة النقض المصرية",
52
+ "label": "COURT",
53
+ "start": 4,
54
+ "end": 25
55
+ },
56
+ {
57
+ "text": "الطعن رقم 123",
58
+ "label": "CASE_NUMBER",
59
+ "start": 29,
60
+ "end": 42
61
+ }
62
+ ],
63
+ "relations": [
64
+ {
65
+ "head": 0,
66
+ "tail": 1,
67
+ "relation": "CASE_COURT"
68
+ }
69
+ ]
70
+ }
71
+ ```
72
+
73
+ ### Data Statistics
74
+
75
+ | Statistic | Value |
76
+ |-----------|-------|
77
+ | Total Examples | 1,046 |
78
+ | Average Text Length | 281 characters |
79
+ | Vocabulary Size | ~7,222 unique terms |
80
+ | Dataset Size | 1.6 MB |
81
+
82
+
83
+ ### Legal Domain Coverage
84
+
85
+ This dataset covers the following areas of Egyptian law: Criminal Law, Labor Law, Civil Law, Administrative Law.
86
+
87
+
88
+ ## Usage
89
+
90
+ ### Loading the Dataset
91
+
92
+ ```python
93
+ from datasets import load_dataset
94
+
95
+ dataset = load_dataset("fr3on/eg-legal-ner")
96
+
97
+ # Print basic info
98
+ print(f"Number of examples: {len(dataset['train'])}")
99
+ print(f"Features: {dataset['train'].features}")
100
+
101
+ # View first example
102
+ print(dataset['train'][0])
103
+ ```
104
+
105
+ ### Example Use Cases
106
+
107
+ - Training legal entity extraction models
108
+ - Building legal knowledge graphs
109
+ - Automated legal document indexing
110
+ - Legal research and analysis tools
111
+
112
+ ## Dataset Creation
113
+
114
+ ### Source Data
115
+
116
+ This dataset was created from Egyptian legal texts including:
117
+
118
+ - **Criminal Procedure Law** (قانون الإجراءات الجنائية) - 498 articles
119
+ - **Personal Status Law** (قانون الأحوال الشخصية) - 51 articles
120
+ - **Penal Code** (قانون العقوبات) - 497 articles
121
+
122
+ ### Data Processing
123
+
124
+ 1. **Text Extraction**: Legal articles extracted from official JSON sources
125
+ 2. **Structure Parsing**: Hierarchical legal structure preserved
126
+ 3. **Schema Conversion**: Converted to ner format
127
+ 4. **Quality Control**: Validated for consistency and proper Arabic encoding
128
+
129
+ ## Considerations for Use
130
+
131
+ ### Intended Use
132
+
133
+ This dataset is intended for:
134
+ - Research in Arabic natural language processing
135
+ - Training legal AI models for Arabic text
136
+ - Educational purposes in computational linguistics
137
+ - Development of legal technology applications
138
+
139
+ ### Limitations
140
+
141
+ - Contains only Egyptian legal texts (may not generalize to other Arabic legal systems)
142
+ - Reflects the specific legal framework and language of Egyptian law
143
+ - Should not be used as a substitute for professional legal advice
144
+ - May contain biases present in the original legal texts
145
+
146
+ ## Citation
147
+
148
+ ```bibtex
149
+ @dataset{arabic_legal_ner_2025,
150
+ title={Arabic Legal Dataset - Legal Named Entity Recognition},
151
+ author={fr3on},
152
+ year={2025},
153
+ publisher={Hugging Face},
154
+ url={https://huggingface.co/datasets/fr3on/eg-legal-ner}
155
+ }
156
+ ```
157
+
158
+ ## License
159
+
160
+ This dataset is released under the Apache 2.0 License. The original legal texts are public domain.
161
+
162
+ ## Acknowledgments
163
+
164
+ Created by [fr3on](https://huggingface.co/fr3on) as part of efforts to advance Arabic legal AI research.