--- license: cc-by-4.0 language: - en - de - es - fr - it - nl - pl - pt - sv task_categories: - token-classification tags: - pii - redaction - secrets - privacy pretty_name: SporeLabs Scrub training data --- # SporeLabs Scrub training data Text labelled with the personal details and secrets in it, each with its type and character offsets. This is the public-text part of the data [SporeLabs Scrub](https://huggingface.co/SporeLabs/scrub) was trained on. Every personal detail in it is a generated value; the people, numbers, keys and codes are not real. ```python from datasets import load_dataset ds = load_dataset("SporeLabs/scrub-data") row = ds["train"][0] for start, end, kind in row["spans"]: print(kind, row["text"][start:end]) ``` | split | documents | |---|---| | `train` | 49,673 | | `dev` | 1,804 | `train` holds 126,846 labelled details; the most common are PERSON 54,977, USERNAME 28,276, ADDRESS 16,160, PHONE 10,943, EMAIL 9,089 and SECRET 7,387. Its documents are spoken requests (18,397, in English, French, German, Spanish, Italian, Dutch, Portuguese, Polish and Swedish), chats (6,660), SMS messages (5,288), chat-log exports (4,906), pasted records and git history (5,628), code and config (5,552), SMS inboxes (2,423), and logs, terminal output, letters and emails. ## Fields | field | what | |---|---| | `id` | row id | | `text` | the document | | `spans` | `[start, end, TYPE]`, character offsets, end exclusive | | `mask_types` | types this row does not label (dates, organisations, places, IPs, IDs, URLs are present but unmarked); a trainer should give those types no loss on this row | | `style` | `asr` for copies written the way a speech recogniser writes them, otherwise empty | | `transforms` | what SporeLabs did to the source text (details replaced, slots filled, a block inserted, a wrapper) | | `sources`, `licences` | the public datasets the row's text came from, and their licences | | `genre` | chat, sms, speech, sms_inbox, chat_log, email, code, config, log and so on | Span types: `PERSON`, `EMAIL`, `PHONE`, `ADDRESS`, `USERNAME`, `SECRET` (keys, tokens, passwords and codes), `CREDIT_CARD`, `BANK`. The released scrubber's rules split `SECRET` into finer types (passwords, codes, keys by provider). ## How SporeLabs built it 1. **Public text.** Chats from WildChat (user turns), SMS messages, spoken assistant requests in nine languages from MASSIVE, OpenAssistant answers, and Keycloak's message templates for sign-in codes. 2. **Real details out.** SporeLabs found the personal details already in the text with its rules and GLiNER2 and replaced each with a generated value of the same kind, labelled. Rows where the two disagreed were left out. In MASSIVE, the human slot annotations mark the names and contacts. Before publishing, SporeLabs Scrub read every row again and any row with an unlabelled detail was left out. 3. **Details where they really turn up.** SporeLabs added generated details in the formats they leak from: command lines, HTTP headers, logs, connection strings, CSV exports, chat and SMS-inbox exports with sign-in codes, git history and email signatures, plus look-alikes that are not sensitive (example keys, test cards, hashes). 4. **Spoken copies.** Some chat, SMS and MASSIVE rows also appear as a speech recogniser would write them, so codes, emails and addresses appear spoken too. The model also trained on two public synthetic sets, [NVIDIA Nemotron-PII](https://huggingface.co/datasets/nvidia/Nemotron-PII) (CC BY 4.0) and [Gretel PII masking EN v1](https://huggingface.co/datasets/gretelai/gretel-pii-masking-en-v1) (Apache-2.0); get them from their own pages. **Code rows.** The model also trained on 40-line windows of public GitHub source files around credential and contact keywords, from [codeparrot/github-code-clean](https://huggingface.co/datasets/codeparrot/github-code-clean) (revision `c48d40f9`, files under MIT, Apache-2.0, BSD, ISC, CC0 or Unlicense only), with the same replacement and insertion steps. Those licences ask for each file's copyright notice, so only the rows from CC0 and Unlicense files are included here; build the rest from that dataset with the steps above. ## Licence and credits The rows are released under CC BY 4.0, and each source's terms also apply to the text taken from it: - WildChat-1M (`allenai/WildChat-1M`, revision `7d6490e4`), Allen Institute for AI, ODC-BY 1.0. Zhao et al., "WildChat: 1M ChatGPT Interaction Logs in the Wild", ICLR 2024. - SMS Spam Collection (`ucirvine/sms_spam`), Almeida and Hidalgo, UCI Machine Learning Repository, CC BY 4.0, https://doi.org/10.24432/C5CC84 - MASSIVE 1.1 (FitzGerald et al., Amazon), CC BY 4.0. - OpenAssistant Conversations oasst2 (`OpenAssistant/oasst2`, revision `179dd21f`), Apache-2.0. - Keycloak message templates (https://github.com/keycloak/keycloak), Apache-2.0 (`licenses/Apache-2.0.txt`). Generated values come from Faker and random strings in each format.