Michael commited on
Commit
fcfc5f4
·
verified ·
1 Parent(s): 72ac7e8

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +146 -3
README.md CHANGED
@@ -1,3 +1,146 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ language:
4
+ - en
5
+ size_categories:
6
+ - 1M<n<10M
7
+ task_categories:
8
+ - text-generation
9
+ - question-answering
10
+ - table-question-answering
11
+ - text2text-generation
12
+ pretty_name: SFD - Stanford EDGAR Filings Dataset (v1)
13
+ tags:
14
+ - finance
15
+ - sec
16
+ - edgar
17
+ - financial-disclosure
18
+ - long-context
19
+ - regulatory
20
+ - 10-K
21
+ - 10-Q
22
+ - 8-K
23
+ - tables
24
+ - multimarkdown
25
+ configs:
26
+ - config_name: default
27
+ data_files:
28
+ - split: train
29
+ path: data/parsed/*.parquet
30
+ ---
31
+
32
+ # SFD: Stanford EDGAR Filings Dataset (v1)
33
+
34
+ **SFD-v1** is an open, layout-faithful reconstruction of U.S. Securities and Exchange Commission (SEC) EDGAR filings into token-efficient MultiMarkdown (MMD), targeted at long-context language modeling, financial reasoning, document understanding, and evaluation.
35
+
36
+ This release covers filings from **January 2022 through June 2025** (~3.4M filings), produced by the SFD parser described in:
37
+
38
+ > *The SEC Filings Dataset: Reconstructing U.S. Corporate and Financial Disclosures into Layout-Faithful and Token-Efficient Pretraining Data.* Bettencourt, Ding, Giesecke (NeurIPS 2026 Evaluations & Datasets Track, under review).
39
+
40
+ The full SFD corpus is estimated at ~500B tokens across ~18.4M filings (1994–present); this release is a public snapshot focused on the most recent four-and-a-half years.
41
+
42
+ ## Key facts
43
+
44
+ - **Format:** [MultiMarkdown](https://fletcher.github.io/MultiMarkdown-6/) — preserves merged-cell tables (`||` colspan, `^^` rowspan), indentation, and visual hierarchy that standard text extraction destroys.
45
+ - **Source formats handled:** HTML (~62%), XML (~18%), plaintext (~18%), SGML (~2%), PDF-via-OCR (~1%) — see paper §3.
46
+ - **Filings:** ~3.4M parsed `.md` documents across 350+ filing types (10-K, 10-Q, 8-K, Form 4, N-PORT, 13F, 485BPOS, ABS-EE, …).
47
+ - **License:** CC-BY-NC-4.0 (parsed). Underlying SEC filings are U.S. Government public domain.
48
+ - **Storage:** Parquet shards with zstd-15 compression, one shard per (year, month).
49
+
50
+ ## Schema
51
+
52
+ Each row is one parsed filing.
53
+
54
+ | field | type | description |
55
+ |-------|------|-------------|
56
+ | `accession` | string | SEC accession number (e.g. `0000320193-24-000123`) |
57
+ | `file_stem` | string | Stem of the original submission file |
58
+ | `year` | int16 | Filing year |
59
+ | `month` | int8 | Filing month (1–12) |
60
+ | `parsed_md` | string | MultiMarkdown reconstruction of the filing |
61
+ | `char_count` | int64 | Character count of `parsed_md` |
62
+ | `md5` | string | MD5 of `parsed_md` (UTF-8) |
63
+ | `has_ocr` | bool | True if any portion required Mistral OCR |
64
+ | `source_format` | string | Primary source format (`html`, `xml`, `plaintext`, `sgml`, `pdf`) |
65
+
66
+ ## Loading
67
+
68
+ ```python
69
+ from datasets import load_dataset
70
+
71
+ ds = load_dataset("mikedd/EDGAR_FILINGS_DATASET", split="train", streaming=True)
72
+ for row in ds.take(1):
73
+ print(row["accession"], row["year"], row["month"], len(row["parsed_md"]))
74
+ ```
75
+
76
+ For a full local materialization (~50 GB on disk):
77
+
78
+ ```python
79
+ ds = load_dataset("mikedd/EDGAR_FILINGS_DATASET", split="train")
80
+ ds = ds.filter(lambda r: r["year"] == 2024) # or by month, source_format, etc.
81
+ ```
82
+
83
+ To recover the canonical SEC EDGAR URL for any row:
84
+
85
+ ```python
86
+ acc = row["accession"] # e.g. "0000320193-24-000123"
87
+ acc_clean = acc.replace("-", "")
88
+ url = f"https://www.sec.gov/Archives/edgar/data/{int(acc.split('-')[0])}/{acc_clean}/"
89
+ ```
90
+
91
+ ## Methodology summary
92
+
93
+ SFD treats filings as 2-D rendered grids rather than DOM trees:
94
+
95
+ - **HTML:** Reconstructs the *visual* coordinate system; collapses the "Three-Column Hack" (\$ / value / closing-paren split into separate cells); coalesces fragmented multi-row headers using `border-*` and `margin-*` cues; preserves indentation hierarchy by binning CSS units into discrete `&nbsp;` levels.
96
+ - **XML:** Routes 33 specialized schemas (Forms 3/4/5, 13F, N-PORT, N-CEN, etc.) through schema-aware emitters that reconstruct human-readable disclosures from field hierarchies.
97
+ - **Plaintext / SGML:** Wraps fixed-width legacy filings in code fences to preserve column alignment; collapses 3+ blank lines to 2.
98
+ - **PDFs:** Run through Mistral OCR 3 in 10-page batches; HTML table fragments converted to MMD; near-blank pages skipped via pixel-variance filter.
99
+
100
+ Every row is prepended with `<SEC-HEADER>`-derived metadata (CIK, SIC, filing type, period of report, etc.) so each filing is self-contained.
101
+
102
+ See paper §3 for full details.
103
+
104
+ ## Companion benchmarks
105
+
106
+ Two evaluation benchmarks are derived from SFD and reported alongside this dataset:
107
+
108
+ - **EDGAR-OCR** — 300 hand-selected SEC tables, synthetically perturbed for contamination resistance, scored by adjusted recall over (content × placement × inline formatting).
109
+ - **EDGAR-Forecast** — 50 companies × 5 numeric targets each (250 total) drawn from 2026 10-Q filings, evaluated agentically with prior 5-year filing history visible.
110
+
111
+ Released separately when scoring is finalized.
112
+
113
+ ## Citation
114
+
115
+ ```bibtex
116
+ @inproceedings{bettencourt2026sfd,
117
+ title={The SEC Filings Dataset: Reconstructing U.S. Corporate and Financial Disclosures into Layout-Faithful and Token-Efficient Pretraining Data},
118
+ author={Bettencourt, Nick and Ding, Xiaowei and Giesecke, Kay},
119
+ booktitle={Advances in Neural Information Processing Systems (NeurIPS), Evaluations \& Datasets Track},
120
+ year={2026}
121
+ }
122
+ ```
123
+
124
+ ## License & terms
125
+
126
+ - **Parsed corpus (this release):** [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) — non-commercial use only with attribution. Derivative works must keep this notice.
127
+ - **Underlying raw filings:** U.S. Government public domain, available canonically from the SEC EDGAR system at <https://www.sec.gov/edgar>. Redistribution of raw filings under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) attribution-style metadata is permitted.
128
+ - **Mistral OCR outputs** (the small PDF subset, `has_ocr == True`) are subject to the [Mistral AI Terms of Service](https://mistral.ai/terms/) at the time of generation; downstream redistribution within this CC BY-NC 4.0 corpus is permitted.
129
+
130
+ ## Ethics, privacy, limitations
131
+
132
+ - All filings are public regulatory disclosures with no expectation of privacy.
133
+ - The dataset preserves filer-supplied content verbatim; SFD does **not** correct factual or accounting errors in the source filings.
134
+ - The MMD reconstruction is high-fidelity but not perfect; estimated ~99% structural/semantic accuracy. A small minority of filings (notably highly visual exhibits with low OCR-recoverable content) may have degraded representation.
135
+ - Token counts reflect the Qwen3-1.7B tokenizer; other tokenizers will differ.
136
+
137
+ ## Provenance & versions
138
+
139
+ - **v1** (this release): 2022-01 → 2025-06, parsed by SFD pipeline rev `sec_parser_v65`.
140
+ - Future releases will extend coverage to 1994–2021 and incrementally to 2025-07+.
141
+
142
+ ## Contact
143
+
144
+ - Nick Bettencourt — `nbetts@g.ucla.edu`
145
+ - Xiaowei Ding — Stanford Advanced Financial Technologies Lab
146
+ - Kay Giesecke — `giesecke@stanford.edu`