--- pretty_name: Insurance Claims & Customer Data (Synthetic Sandbox) license: other license_name: mixed-see-card language: - en tags: - insurance - rag - data-engineering - synthetic - ocr - mlops task_categories: - question-answering - table-question-answering - image-to-text size_categories: - 1K.pdf # 450 claim-form PDFs │ └── scans/.png # the same 450 forms as messy "scanned" images ├── emails/thread_*.txt # 700 support email threads (reply history + personal info) ├── transcripts/call_*.txt # 350 call transcripts (filler words + spoken personal info) ├── real/ # extra real support-chat data │ ├── customer_support_faqs/data.csv │ └── bitext_customer_support/data.csv ├── *_index.json # simple lists of the emails / calls / documents ├── MANIFEST.json # counts + how things connect + the messy parts ├── examples/quickstart.py # a ready-to-run example (load, join, read a file) └── generate.py # the script that made the synthetic data ``` ### The table files (in `structured/`) | File | Comes from | Main columns | Notes | |---|---|---|---| | `crm_customers.csv` | CRM | `customer_id`, `full_name`, `email`, `phone`, `dob`, `ssn`, address… | lowercase names, ISO dates. **About 8% are duplicate rows.** | | `erp_policies.csv` | ERP | `PolicyNo`, `CustomerID`, `LineOfBusiness`, `Premium`, `EffectiveDate`… | different name style, **`MM/DD/YYYY` dates** (different on purpose). | | `claims.csv` | claims | `claim_no`, `policy_no`, `customer_id`, `line`, `filed_date`, `amount_claimed`, `status` | links policies and customers. | ### The files (documents, emails, calls) - **`documents/scans/.png`** — claim forms made to look like real scans (gray, tilted, noisy, blurry). **Read the text and fields out of these images.** - **`documents/pdf/.pdf`** — the clean PDF of each form. - **`emails/thread_*.txt`** — back-and-forth support emails with reply history; the customer's **personal info is in the signature**. - **`transcripts/call_*.txt`** — agent/customer phone chats with filler words ("um", "uh") and **personal info said out loud** (phone, date of birth). ### How everything connects ``` crm_customers.customer_id ─┐ ├─► erp_policies.CustomerID │ └─ erp_policies.PolicyNo ─► claims.policy_no └─► claims.customer_id └─ claims.claim_no ─► documents/{pdf,scans}/ ─► emails (subject + body) ─► transcripts (header + body) ``` The **same person shows up in a claim, a scanned form, an email, and a call.** That's what makes joining, cleaning, and tracing the data a real challenge. ### The messy parts (on purpose) - **Duplicate customers:** the same person saved under different IDs, with capital-letter, spacing, and typo changes, different phone formats, slightly different emails, and some missing fields. - **Different table styles:** one table uses lowercase names + ISO dates, the other uses CamelCase names + `MM/DD/YYYY` dates. - **Personal info inside text:** in emails, transcripts, and scanned forms. - **Messy scans:** hard to read, like real scans. ### How much data | Data | Count | |---|---| | Customer rows (including duplicates) | 2,592 | | Policies | 3,100 | | Claims | 3,900 | | Scanned forms (PNG) + PDFs | 450 + 450 | | Support email threads | 700 | | Call transcripts | 350 | | Extra real support records | 1,700 | --- ## How to download ### Option A — one command, everything (easiest) ```bash pip install -U huggingface_hub hf download EMTIAZZ/data-estate --repo-type dataset --local-dir ./data-estate ``` ### Option B — Python, everything ```python from huggingface_hub import snapshot_download path = snapshot_download(repo_id="EMTIAZZ/data-estate", repo_type="dataset", local_dir="data-estate") print("downloaded to:", path) ``` ### Option C — only part of it (just the images, or just the tables) ```python from huggingface_hub import snapshot_download # only the scanned images: snapshot_download("EMTIAZZ/data-estate", repo_type="dataset", local_dir="scans_only", allow_patterns=["documents/scans/*"]) # only the tables: snapshot_download("EMTIAZZ/data-estate", repo_type="dataset", local_dir="tables_only", allow_patterns=["structured/*"]) ``` ### Option D — one file, no extra tools ```python import pandas as pd url = "https://huggingface.co/datasets/EMTIAZZ/data-estate/resolve/main/structured/claims.csv" claims = pd.read_csv(url) # loads straight from the web ``` ```bash # or with curl: curl -L -o claims.csv "https://huggingface.co/datasets/EMTIAZZ/data-estate/resolve/main/structured/claims.csv" ``` ### Option E — git clone (needs git-lfs for the images/PDFs) ```bash git lfs install git clone https://huggingface.co/datasets/EMTIAZZ/data-estate ``` --- ## How to use it ### Load and join the tables ```python import pandas as pd root = "data-estate" # the folder you downloaded cust = pd.read_csv(f"{root}/structured/crm_customers.csv") pol = pd.read_csv(f"{root}/structured/erp_policies.csv") claims = pd.read_csv(f"{root}/structured/claims.csv") # join the three tables (the column names don't match, so map them): full = (claims .merge(cust, on="customer_id", how="left") .merge(pol, left_on="policy_no", right_on="PolicyNo", how="left")) print(full.shape) ``` ### Load the tables into a database ```bash createdb insurance psql -d insurance -f data-estate/structured/postgres_dump.sql ``` ### Open a scanned form and find its correct values ```python from PIL import Image import pandas as pd, glob, os root = "data-estate" scan = sorted(glob.glob(f"{root}/documents/scans/*.png"))[0] claim_no = os.path.basename(scan).replace(".png", "") img = Image.open(scan) # read the text out of this image truth = pd.read_csv(f"{root}/structured/claims.csv").query("claim_no == @claim_no") print(claim_no, img.size, "\ncorrect values:\n", truth.T) ``` ### Read an email or a transcript ```python print(open(f"{root}/emails/thread_0000.txt").read()) print(open(f"{root}/transcripts/call_0000.txt").read()) ``` ### Or just run the example ```bash python data-estate/examples/quickstart.py data-estate ```