Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
campaign_id
int64
1
120
product_id
int64
1
1.8k
is_hero_sku
bool
2 classes
1
246
false
1
1,376
true
1
747
true
1
619
false
2
627
false
2
95
false
2
567
false
2
41
true
2
503
false
2
1,600
false
2
691
false
2
512
false
2
1,510
false
2
1,481
true
2
640
false
2
1,391
false
2
1,176
false
2
15
false
2
1,754
true
2
26
false
2
219
false
2
165
false
3
58
false
3
1,215
false
3
690
false
3
909
true
3
898
true
3
425
false
3
392
false
3
536
false
3
568
false
3
1,188
true
3
811
false
3
282
false
3
5
true
3
903
false
3
550
false
3
359
false
3
1,365
false
3
751
false
4
186
true
4
188
false
4
233
true
4
1,013
true
4
1,213
false
5
158
false
5
871
false
5
1,649
false
5
1,728
true
5
654
false
5
906
false
5
1,157
false
5
1,024
false
5
443
false
5
410
false
5
466
false
5
1,501
true
5
707
false
5
997
false
5
302
false
5
886
false
5
457
false
5
1,498
false
5
1,047
false
5
1,156
false
6
1,015
true
6
1,550
false
6
287
false
6
136
false
6
1,520
false
6
607
true
6
682
false
6
1,748
false
6
858
false
6
664
false
6
1,237
false
6
1,695
false
6
766
false
6
1,054
false
6
36
false
6
879
false
6
688
false
6
883
false
6
338
false
6
394
false
7
851
false
7
423
false
7
130
true
7
210
false
7
1,297
false
7
649
false
7
587
false
7
1,698
false
7
1,202
false
7
113
true
7
732
false
8
1,007
false
8
1,048
true
8
432
false
8
439
false
End of preview. Expand in Data Studio

Enterprise Corpus — tabular relationship inference & forecasting

Twelve synthetic corpora modelling a multinational business, generated from a declared relational model so the correct answer is known by construction and proven by assertion.

Built to benchmark systems that ingest tabular uploads, infer how the tables relate, produce insights, and forecast.

Corpora 12
Rows 16,476,554
Tables per corpus 22
Foreign keys per corpus 36
Excel workbooks 132
Injected defects 5,752,430
Verification 124/124 checks passing on every corpus

Everything here is 100% synthetic. No personal data, no real company data.


Why this exists

A folder of realistic spreadsheets gives you demos. It does not tell you whether an engine is right, because nobody knows the correct answer.

This corpus works backwards: it declares the relational model — primary keys, foreign keys, cardinalities, grains — generates coherent business data from it, verifies those declarations against the data actually produced, and only then degrades everything into the kind of Excel an enterprise really uploads.


What the data represents

A mid-size multinational that buys, stocks, sells and accounts for physical goods, traded daily for three years (2022-01-01 → 2024-12-31) across 13 countries and 11 currencies.

Trade customers place orders with a named sales rep; orders ship from a distribution centre, are invoiced in local currency, and are delivered, shipped, processing or cancelled. Procurement raises POs on approved suppliers with real lead times. Stock is counted at every warehouse each month end. Marketing runs campaigns against selected products. Finance posts it all to a chart of accounts.

It reconciles: GL revenue accounts tie back to sales line values with a 0.00% gap. That internal consistency is what makes wrong answers detectable.

Four industry variants share the structure and differ in vocabulary and seasonality: consumer_goods, industrial, pharma_distribution, apparel_retail.


Quick start

import pandas as pd, json
from huggingface_hub import snapshot_download

path = snapshot_download("hemanthreddy901/enterprise-corpus", repo_type="dataset")

gt = json.load(open(f"{path}/consumer_goods_medium_mixed_dirty/ground_truth.json"))
edges = [(r["from_table"], r["from_columns"], r["to_table"],
          r["to_columns"], r["cardinality"]) for r in gt["relationships"]]
# -> 36 labelled foreign keys

lines = pd.read_parquet(
    f"{path}/consumer_goods_medium_mixed_dirty/dirty/sales_order_lines.parquet")

Grab a single corpus instead of all 2.5 GB:

snapshot_download("hemanthreddy901/enterprise-corpus", repo_type="dataset",
                  allow_patterns="consumer_goods_medium_mixed_dirty/*")

No account or token is needed to download.


What ships with every corpus

clean/              22 tables as CSV + Parquet, pristine
dirty/              the same tables with defects injected
workbooks/          .xlsx across 4 upload bundles x N difficulty tiers
ground_truth.json   36 FKs with cardinality, PKs, grains, roles, column stats,
                    the true generating process, column_name_map, difficulty score
verification.csv    124 assertions, run on clean data before dirtying
dirt_manifest.json  every defect located, with a how_to_score note
pathologies.json    which Excel corruption hit which sheet

Ground truth is verified before dirt is injected, so the labels are proven against pristine data while the workbooks are built from the dirty version.


The 22 tables

Table Role Primary key Represents
regions dimension region_id EMEA / AMER / APAC reporting regions
countries dimension country_id Countries of operation
currencies dimension currency_code Trading currencies — natural string key
fx_rates rate currency_code + rate_date Daily USD conversion rate
date_calendar calendar date_key Calendar + fiscal attributes, FY starts April
product_categories hierarchy category_id Two-level taxonomy in one table
products dimension product_id Sellable range with lifecycle dates
customers hierarchy customer_id Trade accounts with corporate rollups
suppliers dimension supplier_id Vendors with lead times and terms
product_suppliers bridge product_id + supplier_id True many-to-many
warehouses dimension warehouse_id Distribution centres
employees hierarchy employee_id Staff across 8 departments, manager chains
gl_accounts hierarchy account_code Chart of accounts with parent rollups
marketing_campaigns dimension campaign_id Campaigns with budget and planned lift
campaign_products bridge campaign_id + product_id True many-to-many
sales_orders fact order_id Order headers
sales_order_lines fact_line line_id Line detail — finest transactional grain
sales_returns fact return_id Returns against delivered orders
purchase_orders fact po_id Inbound POs
purchase_order_lines fact_line po_line_id PO line detail
inventory_snapshots snapshot warehouse_id + product_id + snapshot_date Month-end stock — semi-additive
gl_transactions fact gl_id Monthly postings by account and country

Structures that break naive engines

Structure Where The failure it catches
True M:N bridge product_suppliers Row inflation 2.06×; SUM(unit_cost) overstated 108%
Semi-additive snapshot inventory_snapshots 136M units summed across dates vs the correct 3.7M
Self-referencing hierarchy 4 tables Parent and child both summed — silent double-count
Role-specific FK sales_orders.sales_rep_id Targets a subset; 276 of 400 employees never referenced
Composite reference sales_returns → lines Needs two columns matched together
Redundant join path sales_orders.country_id One relationship reported as two independent facts
As-of join fx_rates by order_date A dated lookup treated as an equi-join

Five further relationships are declared in semantic_relationships that no key-matching algorithm can find — procurement lead/lag, GL reconciliation, campaign causality, FX conversion, denormalisation. Score those separately.


Difficulty controls

Column naming

With generated names, 31 of 36 foreign keys are solvable by exact column-name match alone — a twenty-line matcher scores 86% with no inference. Corpora suffixed _mixed disguise columns per table, as four files from four systems:

clean       customer_id      order_date       net_amount
sap         KUNNR            AUDAT            NETWR
legacy      CUST_NO          ORD_DT           NET_AMT
verbose     Customer Account Number            Net Value
bilingual   Kundennummer     Bestelldatum     Nettobetrag
opaque      Col1             FIELD_5          F2

That drops name-solvability to 25%. ground_truth.json → difficulty records the figure, so the benchmark reports its own honesty.

Eight defect classes (_dirty corpora)

Defect Correct handling
orphan_fk — 3.0% point at non-existent IDs Report the relationship anyway
duplicate_entityClearwater Supply Inc / Inc. Merge; clusters supplied
missing_not_at_randomship_date, credit_limit Do not impute
blank_means_zerodiscount_pct Fill with zero
impossible_value — negative qty, dates in 2099/1900 Flag as invalid
unit_inconsistency — 8% of weight_kg in grams Detect bimodal distribution
duplicate_rows — re-uploaded file signature De-duplicate
free_text_column — notes embedding a real po_number Surface the text-only link

The imputation pairing is deliberate: credit_limit blanks must not be filled, discount_pct blanks must be. Same shape, opposite answers.

Four Excel tiers

0 pristine · 1 system export (title block, header on row 5, numbers as text, mixed date formats) · 2 analyst-touched (merged two-row headers, embedded subtotals, month-tab splits needing a union, pivoted P&L) · 3 in the wild (hidden columns, #REF!, CUS-000706 / cus-000477, meaning in fill colour, near-duplicate customers FINAL sheets)


Forecast-grade time series

Sales come from a known process, recorded in data_generating_process, so forecast quality can be scored against the true signal rather than only a holdout: 8.5%/yr trend, weekday shape (Mon 18.9% of revenue → Sun 4.9%), holiday effects (Black Friday 1.65×), product lifecycle, campaign lift, and an 8-week supply shock at 55% through the history.

Month-of-year index (1.00 = average month):

consumer_goods  1:0.71 ... 11:1.45 12:1.37
industrial      1:0.82 ...  7:0.73 12:1.32
pharma          1:1.24 ...  7:0.73 12:1.25
apparel         1:0.64 ... 11:1.44 12:1.41

Pharma peaks in January while apparel bottoms out there at 0.64. A forecaster that learned "Q4 high, Q1 low" from one vertical gets pharma backwards.

A built-in trap: the naive campaign-lift estimate reads ~51% against a true injected lift of ~25%, because the window carries trend and seasonality too. Recovering the real figure needs a control group or a seasonality-adjusted model.


The twelve corpora

Hard mode — mixed naming + injected dirt

Corpus Rows Workbooks Defects
industrial_large_mixed_dirty 12,735,187 8 4,721,338
consumer_goods_medium_mixed_dirty 1,659,139 16 667,136
apparel_retail_small_mixed_dirty 276,961 16 116,788
consumer_goods_small_mixed_dirty 273,611 114,690
pharma_distribution_small_mixed_dirty 269,998 16 112,176
consumer_goods_tiny_mixed_dirty 59,482 4 20,302

Clean baseline — the control group

Corpus Rows Workbooks
apparel_retail_small 276,961 16
consumer_goods_small 273,611 16
pharma_distribution_small 269,998 16
industrial_small 261,377 16
consumer_goods_tiny 59,982 8
apparel_retail_tiny 60,247

Same seed, same row counts — the only variables between a pair are naming and dirt, so the difficulty delta is cleanly attributable. Two corpora have no workbooks (they were --no-excel runs) and remain fully usable for inference testing.

Start with consumer_goods_medium_mixed_dirty, paired with consumer_goods_small as the control.


Suggested metrics

Structure — FK-graph precision/recall · PK and grain detection · cardinality classification, tracking 1:N mistaken for N:M separately because it silently corrupts every downstream number · union-vs-join classification on month tabs.

Interaction — number of confirmation questions asked (budget: ≤7 before users abandon) · accuracy gained per question.

Insight & forecast — recovery of the known DGP components · error vs a seasonal-naive baseline · does it detect the supply shock · does it report the naive 51% campaign lift or the true 25%.

Operational — determinism · cost and latency per workbook · accuracy per tier and per pathology.

The Valentine benchmark (ICDE 2021) formalised this sub-problem and introduced recall @ ground truth for ranking quality — worth adopting rather than reinventing.


Reproducibility

Every corpus is byte-reproducible from its seed — verified: all 22 tables hash-identical on regeneration. The generator is ~360 KB of Python, so regenerating is often cheaper than downloading.

python -m gen.run --industry consumer_goods --scale medium --naming mixed --dirt

Scales: tiny 60k rows / 5s · small 274k / 48s · medium 1.66M / 100s · large 12.7M / 204s.


Limitations

  • One schema in four costumes. Real diversity means different people's design decisions. Pair this with real relational databases for schema variety.
  • Unknown unknowns. A generator only injects defects someone thought of. Real data carries mid-history rule changes and half-finished migrations.
  • Overfitting risk. Tuning against a generator is overfitting with extra steps. Hold out real workbooks the engine is never tuned on.
Downloads last month
41

Paper for hemanthreddy901/enterprise-corpus