Amaanaush RudrakshNanavaty commited on
Commit
56b7be2
·
0 Parent(s):

Duplicate from RudrakshNanavaty/earnings-call-data

Browse files

Co-authored-by: Rudraksh Nanavaty <RudrakshNanavaty@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
13
+ *.mds filter=lfs diff=lfs merge=lfs -text
14
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
+ *.model filter=lfs diff=lfs merge=lfs -text
16
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
17
+ *.npy filter=lfs diff=lfs merge=lfs -text
18
+ *.npz filter=lfs diff=lfs merge=lfs -text
19
+ *.onnx filter=lfs diff=lfs merge=lfs -text
20
+ *.ot filter=lfs diff=lfs merge=lfs -text
21
+ *.parquet filter=lfs diff=lfs merge=lfs -text
22
+ *.pb filter=lfs diff=lfs merge=lfs -text
23
+ *.pickle filter=lfs diff=lfs merge=lfs -text
24
+ *.pkl filter=lfs diff=lfs merge=lfs -text
25
+ *.pt filter=lfs diff=lfs merge=lfs -text
26
+ *.pth filter=lfs diff=lfs merge=lfs -text
27
+ *.rar filter=lfs diff=lfs merge=lfs -text
28
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
29
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
31
+ *.tar filter=lfs diff=lfs merge=lfs -text
32
+ *.tflite filter=lfs diff=lfs merge=lfs -text
33
+ *.tgz filter=lfs diff=lfs merge=lfs -text
34
+ *.wasm filter=lfs diff=lfs merge=lfs -text
35
+ *.xz filter=lfs diff=lfs merge=lfs -text
36
+ *.zip filter=lfs diff=lfs merge=lfs -text
37
+ *.zst filter=lfs diff=lfs merge=lfs -text
38
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
39
+ # Audio files - uncompressed
40
+ *.pcm filter=lfs diff=lfs merge=lfs -text
41
+ *.sam filter=lfs diff=lfs merge=lfs -text
42
+ *.raw filter=lfs diff=lfs merge=lfs -text
43
+ # Audio files - compressed
44
+ *.aac filter=lfs diff=lfs merge=lfs -text
45
+ *.flac filter=lfs diff=lfs merge=lfs -text
46
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ *.ogg filter=lfs diff=lfs merge=lfs -text
48
+ *.wav filter=lfs diff=lfs merge=lfs -text
49
+ # Image files - uncompressed
50
+ *.bmp filter=lfs diff=lfs merge=lfs -text
51
+ *.gif filter=lfs diff=lfs merge=lfs -text
52
+ *.png filter=lfs diff=lfs merge=lfs -text
53
+ *.tiff filter=lfs diff=lfs merge=lfs -text
54
+ # Image files - compressed
55
+ *.jpg filter=lfs diff=lfs merge=lfs -text
56
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
57
+ *.webp filter=lfs diff=lfs merge=lfs -text
58
+ # Video files - compressed
59
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
60
+ *.webm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: mit
5
+ tags:
6
+ - finance
7
+ - earnings
8
+ - transcripts
9
+ - time-series
10
+ - parquet
11
+ - reinforcement-learning
12
+ - sp500
13
+ - xbrl
14
+ - fundamentals
15
+ size_categories:
16
+ - 10K-100K
17
+ task_categories:
18
+ - text-classification
19
+ - summarization
20
+ - feature-extraction
21
+ - text-retrieval
22
+ - reinforcement-learning
23
+ - other
24
+ pretty_name: S&P 500 earnings episodes (2005–2025; merged transcripts, prices, SEC, labels)
25
+ ---
26
+
27
+ # S&P 500 earnings episodes (2005–2025)
28
+
29
+ **Augmented release** built on [`Bose345/sp500_earnings_transcripts`](https://huggingface.co/datasets/Bose345/sp500_earnings_transcripts) (same transcript calendar span as that collection: **2005–2025**). Static tabular data for supervised learning or RL-style experiments on **earnings-call episodes**. Each row is one company–quarter call, keyed by a stable `episode_id`, with long-form text (full earnings transcript, SEC press materials), pre-earnings price context, OHLCV anchors, **SEC XBRL fundamentals** (`xbrl_*` columns), and **post-earnings return labels**.
30
+
31
+ **Companion report:** **`sweetviz_episodes.html`** — a **Sweetviz** profile of `episodes.parquet`, shipped in this dataset repo. [View on the Hub](https://huggingface.co/datasets/RudrakshNanavaty/earnings-call-data/blob/main/sweetviz_episodes.html) or download the [raw file](https://huggingface.co/datasets/RudrakshNanavaty/earnings-call-data/resolve/main/sweetviz_episodes.html) and open it locally in a browser (distributions, missingness, associations).
32
+
33
+ ---
34
+
35
+ ## What’s in this folder
36
+
37
+ These files are the **materialized outputs** of the build pipeline (upstream Hugging Face transcripts → Yahoo Finance prices → SEC EDGAR 8-K press text → feature engineering → merge → optional XBRL join). Intermediate download caches usually live under `data/cache/` locally and are **not** required for analysis if you only use the parquet files below.
38
+
39
+ | File | Role |
40
+ |------|------|
41
+ | **`episodes.parquet`** | **Primary dataset** — one row per episode with identity, text, features, OHLCV anchors, **SEC XBRL fundamentals** (`xbrl_*`), and labels (see [Schema](#schema-episodesparquet)). |
42
+ | **`episodes_press_release_8k.parquet`** | **Subset** of `episodes.parquet`: only rows where `press_release_8k_body` is not null (same schema; fewer rows — on the order of **~16k** after a full pipeline run). [Browse on the Hub](https://huggingface.co/datasets/RudrakshNanavaty/earnings-call-data/blob/main/episodes_press_release_8k.parquet). Produced locally with `uv run python pipeline/filter_episodes_press_release_8k.py`. |
43
+ | **`sweetviz_episodes.html`** | **Exploratory HTML report** (Sweetviz) for `episodes.parquet`; same folder on the Hub as the parquet files ([see below](#sweetviz-html)). |
44
+ | `raw_hf.parquet` | Base transcript metadata and structured content source fields from the upstream Hugging Face dataset (see [Provenance](#provenance)). |
45
+ | `raw_prices.parquet` | Per-episode OHLCV anchors, sector, and price-derived fields from market data. |
46
+ | `raw_press_releases.parquet` | SEC 8-K body and exhibit text (e.g. EX-99.1 / EX-99.2) aligned to each episode. |
47
+ | `features.parquet` | Formatted earnings transcript, text flags, momentum/volume features, and label columns produced in the feature stage. |
48
+
49
+ Rough scale (after a full pipeline run): on the order of **~33k rows** in `episodes.parquet` and **~16k rows** in `episodes_press_release_8k.parquet`, and **hundreds of tickers** (in line with upstream transcript coverage), **2005–2025** span — confirm row and symbol counts on your copy with `len(pd.read_parquet("episodes.parquet"))` and `ep["symbol"].nunique()`.
50
+
51
+ ---
52
+
53
+ ## Schema (`episodes.parquet`)
54
+
55
+ Columns follow this order in the merged export:
56
+
57
+ **Identity:** `episode_id`, `symbol`, `company_name`, `company_id`, `year`, `quarter`, `date`, `earnings_date`, `sector`
58
+
59
+ **Text (observation):** `earnings_transcript`, `press_release_8k_body`, `press_release_ex991`, `press_release_ex992`, `press_release_sources`
60
+
61
+ **Text flags:** `guidance_mentioned`, `beat_mentioned`
62
+
63
+ **Pre-call price features:** `price_momentum_30d`, `price_momentum_90d`, `pct_from_52w_high_pt`, `avg_volume_20d`
64
+
65
+ **OHLCV anchors (grading / simulation):** `d_minus_1_*`, `d_plus_1_*`, `d_plus_30_*`, `next_qtr_d_minus_1_*` (open, high, low, close, volume as listed in the table)
66
+
67
+ **Labels / targets:** `sentiment_label`, `move_1d`, `move_30d`, `move_next_qtr`, `move_1d_direction`, `gap_open_d1`, `volume_surge_d1`
68
+
69
+ **Audit / quality:** `next_qtr_date`
70
+
71
+ **XBRL (SEC EDGAR companyfacts, 2009+):** Per-episode numeric facts from the SEC **company facts** JSON API (`data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json`), documented under [SEC EDGAR APIs](https://www.sec.gov/edgar/sec-api-documentation). Facts use **`us-gaap`** concepts only. Episodes with **`year < 2009`** have nulls in all `xbrl_*` columns (no companyfacts match is attempted for those rows).
72
+
73
+ **How it is joined:** each episode’s ticker maps to a **CIK** via the same SEC ticker map used elsewhere in the pipeline (`data/cache/edgar/cik_map.json`, built during EDGAR steps or with `uv run python pipeline/build_cik_map.py`). If no CIK is found, companyfacts are not fetched for that row. After the merged table exists, run:
74
+
75
+ `uv run python pipeline/06_xbrl.py`
76
+
77
+ That step fills `xbrl_*` on **`episodes.parquet`** and refreshes **`episodes_press_release_8k.parquet`** with the same columns. Requests respect SEC rate limits (under 10 requests per second). When you run the pipeline locally, gaps and reasons are appended to **`reports/failures_xbrl.csv`** (not required to use the Hub parquet).
78
+
79
+ **Matching logic:** each metric tries **several GAAP local names in priority order** (e.g. revenue tries `Revenues`, then revenue-from-contract variants, then net sales) so more cells populate despite issuer tag choice; see `pipeline/06_xbrl.py` for the exact chains.
80
+
81
+ **Provenance (string):** for each value column there is a sibling `*_tag` column (e.g. `xbrl_revenue_tag`) with the **winning** local GAAP name, or null if the value is null.
82
+
83
+ - **Income statement:** `xbrl_revenue`, `xbrl_cost_of_revenue`, `xbrl_gross_profit`, `xbrl_operating_income`, `xbrl_net_income`, `xbrl_eps_basic`, `xbrl_eps_diluted` — plus `xbrl_revenue_tag`, …, `xbrl_eps_diluted_tag`
84
+ - **Balance sheet:** `xbrl_cash_and_cash_equivalents`, `xbrl_total_assets`, `xbrl_total_liabilities` — plus `xbrl_cash_and_cash_equivalents_tag`, `xbrl_total_assets_tag`, `xbrl_total_liabilities_tag`
85
+ - **Cash flow:** `xbrl_net_cash_operating_activities`, `xbrl_capital_expenditures` — plus `xbrl_net_cash_operating_activities_tag`, `xbrl_capital_expenditures_tag`
86
+
87
+ Treat these fields as **best-effort fundamentals aligned to the earnings quarter**, not audited restatements; expect **sparse cells** where filings, tags, or timing do not yield a match.
88
+
89
+ `sentiment_label` is derived from `move_1d` using fixed percentage bands (very bearish through very bullish). Treat labels as **historical hindsight** for research, not investment advice.
90
+
91
+ ---
92
+
93
+ ## Sweetviz HTML
94
+
95
+ The **Sweetviz** report is an exploratory companion to **`episodes.parquet`** only. It summarizes column types, missingness, numeric distributions, and target associations without loading the full frame in a notebook.
96
+
97
+ **On this Hub repo** the file lives next to the parquet exports:
98
+
99
+ - **Filename:** `sweetviz_episodes.html`
100
+ - **Browse:** [dataset files → `sweetviz_episodes.html`](https://huggingface.co/datasets/RudrakshNanavaty/earnings-call-data/tree/main)
101
+ - **Direct download:** [`.../resolve/main/sweetviz_episodes.html`](https://huggingface.co/datasets/RudrakshNanavaty/earnings-call-data/resolve/main/sweetviz_episodes.html)
102
+
103
+ **Download with Python** ([`huggingface_hub`](https://huggingface.co/docs/huggingface_hub)):
104
+
105
+ ```python
106
+ from huggingface_hub import hf_hub_download
107
+
108
+ path = hf_hub_download(
109
+ repo_id="RudrakshNanavaty/earnings-call-data",
110
+ filename="sweetviz_episodes.html",
111
+ repo_type="dataset",
112
+ )
113
+ print(path) # open this path in a browser
114
+ ```
115
+
116
+ **Regenerate locally** (from the pipeline repo that produced these files):
117
+
118
+ `uv run python pipeline/sweetviz_report.py data/episodes.parquet -o reports/sweetviz_episodes.html`
119
+
120
+ Sweetviz is a third-party tool; report content reflects the table at generation time.
121
+
122
+ ---
123
+
124
+ ## Provenance
125
+
126
+ - **Transcripts / call metadata:** same underlying universe and years as [`Bose345/sp500_earnings_transcripts`](https://huggingface.co/datasets/Bose345/sp500_earnings_transcripts) (this release **augments** those transcripts with market, SEC, and label columns; respect that dataset’s license and terms when redistributing derived work).
127
+ - **Market data:** via [yfinance](https://github.com/ranaroussi/yfinance) (subject to Yahoo / vendor terms of use).
128
+ - **Filings:** U.S. SEC EDGAR public data (comply with [SEC fair access](https://www.sec.gov/os/accessing-edgar-data) and rate-limiting expectations when re-fetching).
129
+ - **XBRL fundamentals:** derived from SEC **company facts** (same public data policy as above); re-fetch only with a proper [User-Agent](https://www.sec.gov/os/accessing-edgar-data) and polite throughput.
130
+
131
+ This package is a **processed merge** for research; it is not an official SEC or exchange product.
132
+
133
+ ---
134
+
135
+ ## Loading examples
136
+
137
+ **pandas / PyArrow**
138
+
139
+ ```python
140
+ import pandas as pd
141
+
142
+ ep = pd.read_parquet("episodes.parquet")
143
+ print(ep.shape, ep.columns[:5].tolist())
144
+
145
+ # Optional: only episodes with SEC 8-K body text populated
146
+ ep_8k = pd.read_parquet("episodes_press_release_8k.parquet")
147
+ print(ep_8k.shape)
148
+
149
+ # Optional: rows with at least headline XBRL (example)
150
+ ep_xbrl = ep.dropna(subset=["xbrl_revenue", "xbrl_net_income"])
151
+ print(ep_xbrl.shape)
152
+ ```
153
+
154
+ **Hugging Face `datasets`** (if you upload parquet to a Hub dataset repo)
155
+
156
+ ```python
157
+ from datasets import Dataset
158
+
159
+ ds = Dataset.from_parquet("episodes.parquet") # or hf://datasets/<user>/<name>/path.parquet
160
+ print(ds)
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Use cases
166
+
167
+ - Train or evaluate models on **text + tabular market context** with aligned **forward returns** and optional **reported fundamentals** (`xbrl_*`).
168
+ - Build **RL environments** where observations include call text and pre-earnings features and rewards depend on realized moves (subject to your own leakage and causality checks).
169
+ - Reproduce or extend the pipeline using the sibling repository that emits these files.
170
+
171
+ ---
172
+
173
+ ## Limitations
174
+
175
+ - Rows may contain **nulls** where a source (e.g. a filing or price window) was missing; use the audit columns and null summaries in the Sweetviz report or your own QC.
176
+ - **`xbrl_*` columns are intentionally sparse:** many episodes will have nulls (no CIK, no matching GAAP fact for the quarter, or `year < 2009`). Do not assume complete fundamentals coverage.
177
+ - **Survivorship and sample bias** follow the upstream universe and filters.
178
+ - **Non-stationarity:** financial regimes change; test generalization across time and sectors.
179
+
180
+ ---
181
+
182
+ ## Citation
183
+
184
+ If you use this dataset, cite the **upstream transcript dataset** as its authors request, plus a citation or link to **this Hub dataset**. Example BibTeX skeleton (fill in author as appropriate):
185
+
186
+ ```bibtex
187
+ @misc{earnings_episodes_2026,
188
+ title = {S\&P 500 Earnings Episodes (merged transcripts, prices, SEC, labels)},
189
+ author = {YOUR NAME OR ORG},
190
+ year = {2026},
191
+ howpublished = {\url{https://huggingface.co/datasets/RudrakshNanavaty/earnings-call-data}},
192
+ note = {Augments Bose345/sp500\_earnings\_transcripts (2005--2025); adds yfinance, SEC EDGAR-derived fields, and optional SEC XBRL companyfacts (us-gaap) on episodes from 2009+.}
193
+ }
194
+ ```
195
+
196
+ ---
197
+
198
+ ## License
199
+
200
+ This dataset card specifies **MIT** (`license: mit` in the frontmatter). You remain responsible for **upstream** terms (e.g. the Hugging Face transcript dataset, Yahoo/yfinance, SEC redistribution) when publishing or redistributing derived data.
episodes.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c7a7c8c33e4896e12f2fb7def8af3b35c3f898e02c2e6be59939a99141d064b
3
+ size 1157543169
episodes_press_release_8k.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:032cf56437716d4a7d4845a6836bccf0a8e7722a2ae3eea04db180c7ce28a28e
3
+ size 697489054
features.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:168bcd65f8f8b8d67f8e14231d166db439db7967f49e29b4f0b57b3a58f584ff
3
+ size 890157669
raw_hf.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3867d26b65017dc2433b51dc4eca5adcfec56046eb1e5d68b8c570b32febd18
3
+ size 890190253
raw_press_releases.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9253d7a4ab8a3b11b75601e3731f132b15902d20636fd186a43cc9db8f1e311d
3
+ size 260018620
raw_prices.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb475c780f34a9ddf8a109c059ab6b4cfa8db1849cbc9018a6c608cb1ab55173
3
+ size 5493083
sweetviz_episodes.html ADDED
The diff for this file is too large to render. See raw diff