CordwainerSmith commited on
Commit
b7006f9
โ€ข
1 Parent(s): 880890f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +285 -3
README.md CHANGED
@@ -1,3 +1,285 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+
5
+ # GolemGuard: Hebrew Privacy Information Detection Corpus
6
+
7
+ ## Dataset Summary
8
+
9
+ GolemGuard is a comprehensive Hebrew language dataset specifically designed for training and evaluating models for Personal Identifiable Information (PII) detection and masking. The dataset contains ~600MB of synthetic text data representing various document types and communication formats commonly found in Israeli professional and administrative contexts.
10
+
11
+ ## Source Data
12
+ ### Initial Data Collection and Normalization
13
+
14
+ The dataset combines synthetic data generated from multiple authoritative sources:
15
+
16
+ 1. Names:
17
+ - Israeli government open data portal (data.gov.il) for first names
18
+ - Hebrew Wikipedia category for family names
19
+ - Faker library
20
+ - Additional curated sources
21
+
22
+ 2. Addresses:
23
+ - Israeli government datasets for cities
24
+ - Israeli government street names datasets
25
+
26
+ 3. Synthetic Identifiers:
27
+ - ID numbers: Generated following Israeli ID number format and checksum rules
28
+ - Bank accounts: Generated following Israeli bank account number formats
29
+ - Postal codes: Based on valid Israeli postal code ranges
30
+ - Credit cards: Generated following valid card number algorithms
31
+ - Email addresses: Constructed using collected names and top Israeli email providers
32
+
33
+ ### Entity Types:
34
+
35
+ | PII Entity Type | Description | Count |
36
+ |----------------|-------------|-------|
37
+ | FIRST_NAME | First names | 131,192 |
38
+ | LAST_NAME | Last names | 115,020 |
39
+ | ID_NUM | Israeli ID numbers | 77,902 |
40
+ | PHONE_NUM | Phone numbers (both mobile and landlines) | 142,795 |
41
+ | DATE | Dates | 77,042 |
42
+ | STREET | Street addresses | 105,381 |
43
+ | CITY | City names | 105,874 |
44
+ | EMAIL | Email addresses | 90,080 |
45
+ | POSTAL_CODE | Israeli postal codes (Mikud) | 93,748 |
46
+ | BANK_ACCOUNT_NUM | Bank account numbers | 31,046 |
47
+ | CC_NUM | Credit card numbers | 1,751 |
48
+ | CC_PROVIDER | Credit card providers | 1,679 |
49
+
50
+ ### Template Diversity
51
+
52
+ The dataset includes 2,607 unique document templates. Here are the top document types by instance count:
53
+
54
+ | Template Type | Instance Count |
55
+ |--------------|----------------|
56
+ | meeting_summary | 21,983 |
57
+ | appointment_confirmation | 4,420 |
58
+ | job_application_confirmation | 3,611 |
59
+ | job_application | 3,306 |
60
+ | medical_appointment_confirmation | 2,359 |
61
+ | loan_application_received | 1,988 |
62
+ | job_application_received | 1,832 |
63
+ | bank_account_update | 1,609 |
64
+ | appointment_reminder | 1,567 |
65
+ | medical_appointment_reminder | 1,335 |
66
+
67
+ ### Dataset Size
68
+ - Total Size: ~600MB
69
+ - Number of Examples: 115,453
70
+ - Format: JSONL
71
+
72
+ ### Data Splits
73
+
74
+ | Split | Number of Instances |
75
+ |-------|-------------------|
76
+ | Training | 97,453 |
77
+ | Test | 18,000 |
78
+ | **Total** | **115,453** |
79
+
80
+
81
+ ## Languages
82
+
83
+ - Hebrew (he)
84
+ - Locale: Israel (IL)
85
+
86
+ ## Supported Tasks
87
+
88
+ - Token Classification
89
+ - Named Entity Recognition (NER)
90
+ - PII Detection
91
+ - Text Masking
92
+ - Privacy-Preserving Text Processing
93
+
94
+ ## Dataset Structure
95
+
96
+ ### Data Instances
97
+
98
+ Each instance in the dataset contains:
99
+
100
+ ```json
101
+ {
102
+ "id": "String", // Unique identifier
103
+ "source_text": "String", // Original text with PII
104
+ "masked_text": "String", // Text with PII entities masked
105
+ "locale": "String", // Always "IL"
106
+ "language": "String", // Always "he"
107
+ "split": "String", // "train" or "test"
108
+ "privacy_mask": [ // List of PII entities with positions
109
+ {
110
+ "label": "String", // Entity type
111
+ "start": "Integer", // Start position
112
+ "end": "Integer", // End position
113
+ "value": "String", // Original value
114
+ "label_index": "Integer" // Index for multiple entities of same type
115
+ }
116
+ ],
117
+ "span_labels": "List", // Entity spans in [start, end, label] format
118
+ "tokens": "List", // Tokenized text
119
+ "token_classes": "List", // Token-level BIO tags
120
+ "input_ids": "List", // Model input token IDs
121
+ "attention_mask": "List", // Attention mask for padding
122
+ "offset_mapping": "List", // Character offsets for tokens
123
+ "template_type": "String" // Document type/template
124
+ }
125
+ ```
126
+ ### Sample
127
+ ```json
128
+ {"id": "entry_000256", "source_text": "ืžืฉืชืชืฃ: ื“ื•ืœื‘ ืฉื ื˜ื•ื‘\nืชืืจื™ืš ืœื™ื“ื”: 28.08.97\nื›ืชื•ื‘ืช: ืกื—ืจื•ื‘ ื“ื•ื“ 158, ืงืจื™ื™ืช ื™ื, 2676389\nืื™ืžื™ื™ืœ: [email protected]\nื˜ืœืคื•ืŸ: +972-58-2892208\n\nืกื™ื›ื•ื ื”ืคื’ื™ืฉื”: ื‘ืคื’ื™ืฉื” ื–ื• ื ื“ื•ื ื” ื—ืฉื™ื‘ื•ืช ืฉื™ืคื•ืจ ื”ืชืงืฉื•ืจืช ื”ืคื ื™ืžื™ืช ื‘ื™ืŸ ื”ืฆื•ื•ืชื™ื. ื”ื•ื—ืœื˜ ืœื‘ืฆืข ืกื“ื ืื•ืช ืœื”ื›ืฉืจื” ื ื•ืกืคืช ื‘ืฉื‘ื•ืข ื”ื‘ื.", "masked_text": "ืžืฉืชืชืฃ: [FIRST_NAME_1] [LAST_NAME_1]\nืชืืจื™ืš ืœื™ื“ื”: [DATE_1]\nื›ืชื•ื‘ืช: [STREET_1], [CITY_1], [POSTAL_CODE_1]\nืื™ืžื™ื™ืœ: [EMAIL_1]\nื˜ืœืคื•ืŸ: [PHONE_NUM_1]\n\nืกื™ื›ื•ื ื”ืคื’ื™ืฉื”: ื‘ืคื’ื™ืฉื” ื–ื• ื ื“ื•ื ื” ื—ืฉื™ื‘ื•ืช ืฉื™ืคื•ืจ ื”ืชืงืฉื•ืจืช ื”ืคื ื™ืžื™ืช ื‘ื™ืŸ ื”ืฆื•ื•ืชื™ื. ื”ื•ื—ืœื˜ ืœื‘ืฆืข ืกื“ื ืื•ืช ืœื”ื›ืฉ๏ฟฝ๏ฟฝื” ื ื•ืกืคืช ื‘ืฉื‘ื•ืข ื”ื‘ื.", "locale": "IL", "language": "he", "split": "train", "privacy_mask": [{"label": "FIRST_NAME", "start": 7, "end": 11, "value": "ื“ื•ืœื‘", "label_index": 1}, {"label": "LAST_NAME", "start": 12, "end": 18, "value": "ืฉื ื˜ื•ื‘", "label_index": 1}, {"label": "DATE", "start": 31, "end": 39, "value": "28.08.97", "label_index": 1}, {"label": "STREET", "start": 47, "end": 60, "value": "ืกื—ืจื•ื‘ ื“ื•ื“ 158", "label_index": 1}, {"label": "CITY", "start": 62, "end": 70, "value": "ืงืจื™ื™ืช ื™ื", "label_index": 1}, {"label": "POSTAL_CODE", "start": 72, "end": 79, "value": "2676389", "label_index": 1}, {"label": "EMAIL", "start": 88, "end": 111, "value": "[email protected]", "label_index": 1}, {"label": "PHONE_NUM", "start": 119, "end": 134, "value": "+972-58-2892208", "label_index": 1}], "span_labels": [[7, 11, "FIRST_NAME"], [12, 18, "LAST_NAME"], [31, 39, "DATE"], [47, 60, "STREET"], [62, 70, "CITY"], [72, 79, "POSTAL_CODE"], [88, 111, "EMAIL"], [119, 134, "PHONE_NUM"]], "tokens": ["<s>", "โ–ืž", "ืฉืชืชืฃ", ":", "โ–ื“ื•", "ืœื‘", "โ–ืฉื", "โ–ื˜ื•ื‘", "โ–", "ืชืืจื™ืš", "โ–", "ืœื™ื“ื”", ":", "โ–28.", "08.", "97", "โ–ื›ืชื•ื‘ืช", ":", "โ–", "ืกื—ืจ", "ื•ื‘", "โ–ื“ื•ื“", "โ–158", ",", "โ–ืงืจื™", "ื™ืช", "โ–", "ื™ื", ",", "โ–26", "76", "389", "โ–ืื™ืžื™ื™ืœ", ":", "โ–sa", "git", "ben", "dor", "760", "@", "live", ".", "com", "โ–ื˜ืœืคื•ืŸ", ":", "โ–+", "97", "2-", "58", "-28", "92", "208", "โ–", "ืกื™ื›ื•ื", "โ–ื”ืค", "ื’ื™ืฉื”", ":", "โ–ื‘ืค", "ื’ื™ืฉื”", "โ–ื–ื•", "โ–", "ื ื“", "ื•ื ื”", "โ–", "ื—ืฉื™ื‘ื•ืช", "โ–", "ืฉื™ืคื•ืจ", "โ–ื”ืชืงืฉื•ืจืช", "โ–ื”ืคื ื™ืžื™", "ืช", "โ–ื‘ื™ืŸ", "โ–ื”ืฆื•ื•ืช", "ื™ื", ".", "โ–ื”", "ื•ื—", "ืœื˜", "โ–ืœื‘ืฆืข", "โ–", "ืกื“ื ืื•ืช", "โ–ืœ", "ื”ื›ืฉืจื”", "โ–ื ื•ืกืคืช", "โ–ื‘ืฉื‘ื•ืข", "โ–ื”ื‘ื", ".", "</s>"], "token_classes": ["O", "O", "O", "O", "B-FIRST_NAME", "I-FIRST_NAME", "B-LAST_NAME", "I-LAST_NAME", "O", "O", "O", "O", "O", "B-DATE", "I-DATE", "I-DATE", "O", "O", "B-STREET", "I-STREET", "I-STREET", "I-STREET", "I-STREET", "O", "B-CITY", "I-CITY", "I-CITY", "I-CITY", "O", "B-POSTAL_CODE", "I-POSTAL_CODE", "I-POSTAL_CODE", "O", "O", "B-EMAIL", "I-EMAIL", "I-EMAIL", "I-EMAIL", "I-EMAIL", "I-EMAIL", "I-EMAIL", "I-EMAIL", "I-EMAIL", "O", "O", "B-PHONE_NUM", "I-PHONE_NUM", "I-PHONE_NUM", "I-PHONE_NUM", "I-PHONE_NUM", "I-PHONE_NUM", "I-PHONE_NUM", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O", "O"], "input_ids": [0, 874, 177834, 12, 18133, 22849, 16804, 19767, 6, 174081, 6, 119583, 12, 12511, 17331, 14773, 86185, 12, 6, 214797, 18340, 67512, 78373, 4, 46050, 2754, 6, 448, 4, 1381, 11835, 119861, 194921, 12, 57, 15769, 776, 1846, 110216, 981, 24056, 5, 277, 167153, 12, 997, 14773, 18504, 10057, 48590, 12231, 154782, 6, 186708, 18338, 58366, 12, 65412, 58366, 8248, 6, 16747, 15703, 6, 148055, 6, 154997, 185983, 214547, 609, 7501, 192819, 448, 5, 364, 15662, 21295, 107543, 6, 199930, 657, 226909, 122485, 132299, 54641, 5, 2], "attention_mask": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "offset_mapping": [[0, 0], [0, 1], [1, 5], [5, 6], [7, 9], [9, 11], [12, 14], [15, 18], [19, 20], [19, 24], [25, 26], [25, 29], [29, 30], [31, 34], [34, 37], [37, 39], [40, 45], [45, 46], [47, 48], [47, 50], [50, 52], [53, 56], [57, 60], [60, 61], [62, 65], [65, 67], [68, 69], [68, 70], [70, 71], [72, 74], [74, 76], [76, 79], [80, 86], [86, 87], [88, 90], [90, 93], [93, 96], [96, 99], [99, 102], [102, 103], [103, 107], [107, 108], [108, 111], [112, 117], [117, 118], [119, 120], [120, 122], [122, 124], [124, 126], [126, 129], [129, 131], [131, 134], [136, 137], [136, 141], [142, 144], [144, 148], [148, 149], [150, 152], [152, 156], [157, 159], [160, 161], [160, 162], [162, 165], [166, 167], [166, 172], [173, 174], [173, 178], [179, 186], [187, 193], [193, 194], [195, 198], [199, 204], [204, 206], [206, 207], [208, 209], [209, 211], [211, 213], [214, 218], [219, 220], [219, 225], [226, 227], [227, 232], [233, 238], [239, 244], [245, 248], [248, 249], [0, 0]], "template_type": "meeting_summary"}
129
+ ```
130
+
131
+ ## Considerations for Using the Data
132
+
133
+ ### Social Impact of Dataset
134
+
135
+ The dataset aims to improve privacy protection in Hebrew text processing by enabling better PII detection and masking. This has important applications in:
136
+
137
+ | Application Area | Description |
138
+ |-----------------|-------------|
139
+ | Regulatory Compliance | Support for GDPR and PPLA requirements |
140
+ | Document Processing | Privacy-preserving text analysis and storage |
141
+ | Information Security | Automated PII detection and protection |
142
+ | Data Loss Prevention | Real-time PII identification and masking |
143
+
144
+ ### Discussion of Biases
145
+
146
+ 1. Geographic Bias
147
+ - Dataset focuses on Israeli context and formats
148
+
149
+ 2. Name Distribution
150
+ - While effort was made to include diverse names, distribution may not perfectly match population demographics
151
+
152
+
153
+ ## Additional Information
154
+
155
+ ### Dataset Curators
156
+
157
+ Dataset was curated by ([Liran Baba](https://huggingface.co/CordwainerSmith)).
158
+
159
+
160
+ ### Model Training
161
+
162
+ Dataset was curated for training the [GolemPII-xlm-roberta-v1][model-link] model by Liran Baba (CordwainerSmith), model, demonstrating its effectiveness for PII detection and masking tasks in Hebrew text.
163
+
164
+ [model-link]: https://huggingface.co/CordwainerSmith/GolemPII-xlm-roberta-v1
165
+
166
+ ### Recommended Uses
167
+
168
+ | Use Case | Description |
169
+ |----------|-------------|
170
+ | Privacy Protection | Identifying and masking PII in Hebrew documents |
171
+ | Compliance Checking | Automated PII detection for regulatory compliance |
172
+ | Data Sanitization | Cleaning sensitive information from text data |
173
+ | Information Security | Supporting data loss prevention systems |
174
+
175
+ ### Quick Start
176
+ ```python
177
+ from datasets import load_dataset
178
+
179
+ # Load dataset
180
+ dataset = load_dataset("GolemGuard")
181
+
182
+ # Example usage
183
+ sample = dataset['train'][0]
184
+ print(f"Original text: {sample['source_text']}")
185
+ print(f"Masked text: {sample['masked_text']}")
186
+ ```
187
+ ### Versioning
188
+
189
+ This is the initial release of the dataset. Future versions may include:
190
+ - Additional template types
191
+ - Expanded entity coverage
192
+ - Enhanced demographic representation
193
+ - Additional language variants
194
+
195
+ ## Citation and Usage Information
196
+
197
+ If you use this dataset in your research or project, please include the following information:
198
+
199
+ ```
200
+ Dataset: GolemGuard
201
+ Author: Liran Baba (CordwainerSmith)
202
+ URL: https://huggingface.co/datasets/GolemGuard
203
+ Related Model: https://huggingface.co/CordwainerSmith/GolemPII-xlm-roberta-v1
204
+ Version: 1.0.0
205
+ Release Date: Oct 2024
206
+ ```
207
+
208
+ You can cite this dataset as:
209
+
210
+ > GolemGuard (2024) by Liran Baba. A comprehensive Hebrew PII detection dataset containing ~600MB of synthetic text data. Available at: https://huggingface.co/datasets/GolemGuard
211
+
212
+ For academic papers, you might reference both the dataset and model:
213
+
214
+ > We utilized the GolemGuard dataset and GolemPII-xlm-roberta-v1 model (Baba, 2024) for Hebrew PII detection and masking tasks.
215
+
216
+
217
+ ## License
218
+
219
+ The GolemGuard dataset is released under MIT License with the following additional terms:
220
+
221
+ ```
222
+ MIT License
223
+
224
+ Copyright (c) 2024 Liran Baba
225
+
226
+ Permission is hereby granted, free of charge, to any person obtaining a copy
227
+ of this dataset and associated documentation files (the "Dataset"), to deal
228
+ in the Dataset without restriction, including without limitation the rights
229
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
230
+ copies of the Dataset, and to permit persons to whom the Dataset is
231
+ furnished to do so, subject to the following conditions:
232
+
233
+ 1. The above copyright notice and this permission notice shall be included in all
234
+ copies or substantial portions of the Dataset.
235
+
236
+ 2. Any academic or professional work that uses this Dataset must include an
237
+ appropriate citation as specified below.
238
+
239
+ THE DATASET IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
240
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
241
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
242
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
243
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
244
+ OUT OF OR IN CONNECTION WITH THE DATASET OR THE USE OR OTHER DEALINGS IN THE
245
+ DATASET.
246
+ ```
247
+
248
+ ### How to Cite
249
+
250
+ If you use this dataset in your research, project, or application, please include the following citation:
251
+
252
+ For informal usage (e.g., blog posts, documentation):
253
+ ```
254
+ GolemGuard Dataset by Liran Baba (https://huggingface.co/datasets/GolemGuard)
255
+ ```
256
+
257
+ For academic or professional publications:
258
+ ```
259
+ Baba, L. (2024). GolemGuard: A Professional Hebrew PII Detection Dataset.
260
+ Retrieved from https://huggingface.co/datasets/GolemGuard
261
+
262
+ Related model: GolemPII-xlm-roberta-v1 (https://huggingface.co/CordwainerSmith/GolemPII-xlm-roberta-v1)
263
+ ```
264
+
265
+ ### Usage Examples
266
+
267
+ When referencing in your code:
268
+ ```python
269
+ """
270
+ This code uses the GolemGuard dataset by Liran Baba
271
+ (https://huggingface.co/datasets/GolemGuard)
272
+ """
273
+
274
+ from datasets import load_dataset
275
+ dataset = load_dataset("GolemGuard")
276
+ ```
277
+
278
+ When referencing in your model card:
279
+ ```yaml
280
+ dataset_info:
281
+ - name: GolemGuard
282
+ author: Liran Baba
283
+ url: https://huggingface.co/datasets/GolemGuard
284
+ year: 2024
285
+ ```