DoDataThings's picture
v1.0.0 — initial release
c3655d4 verified
---
license: apache-2.0
language: en
size_categories:
- 10K<n<100K
task_categories:
- text-classification
tags:
- trading
- intent-classification
- human-curated
- augmented
- english
---
# trade-decision-classifier-v1-dataset
Human-curated + synthetically augmented dataset for training trading-agent reply classifiers. Companion to [DoDataThings/distilbert-trade-decision-classifier-v1](https://huggingface.co/DoDataThings/distilbert-trade-decision-classifier-v1).
## Why this dataset
Trading agents that DM trade proposals to a human reviewer and accept free-form text replies need a way to convert those replies into discrete actions. There's no off-the-shelf dataset for this — sentiment classifiers don't capture the action space, and general intent classifiers don't understand the resize / reprice / defer distinctions specific to trade decisions.
This dataset fills that gap with a balanced, hand-curated 6-label corpus covering canonical replies and adversarial cases. The taxonomy and seeds were iterated against a working trading-agent reply distribution over multiple training cycles.
## TL;DR
- **25,200 training rows** generated by augmenting 1,047 human-written seed phrases via case / punctuation / whitespace and structural-prefix expansion (~24× per seed). Seeds are natural reply phrasings, not LLM-generated text.
- **175 held-out eval rows**, hand-curated, adversarial-leaning, zero-leakage verified against training.
- **6 balanced classes** — between 4,080 and 4,608 rows each.
- **Reproducible** — re-running the generator script with `--seed-rng 42` produces byte-identical output.
## Class distribution
| Label | Train | Eval | What it covers |
| -------------- | ------ | ---- | -------------- |
| APPROVE | 4,152 | 30 | Execute as proposed. "yes", "approve", "let's go" |
| DECLINE | 4,128 | 30 | Kill the proposal. "no", "pass", "kill it" |
| HOLD | 4,152 | 34 | Active deferral. "hold off", "checking", "leaning approve" |
| COUNTER_SIZE | 4,080 | 30 | Approve at different share count. "size 10", "dump half" |
| COUNTER_PRICE | 4,080 | 25 | Approve at different limit price. "at $49", "limit 50" |
| UNCLEAR | 4,608 | 26 | No committable position. Multi-intent, off-topic, ambiguous. |
UNCLEAR is slightly larger because it includes template-generated multi-intent examples using a 100-ticker pool (see Variation dimensions below).
## Schema
Each row is a JSON object:
```json
{
"text": "[dm][reply_to:131967][in_flight:1] Reject!",
"label": "DECLINE",
"label_id": 1,
"seed": "reject"
}
```
Fields:
- `text` — the prefixed input fed to the model
- `label` — string label
- `label_id` — int [0, 5]
- `seed` (train only) — original seed phrase, or `_ticker_tmpl_<...>` for template-generated rows
- `raw_text` (eval only) — original text before prefix wrap
- `note` (eval only) — curator's category note
Label ID mapping:
```
{"APPROVE": 0, "DECLINE": 1, "HOLD": 2,
"COUNTER_SIZE": 3, "COUNTER_PRICE": 4, "UNCLEAR": 5}
```
## Structural prefix scheme
Every row's `text` field starts with three tags carrying chat context:
```
[dm|group][reply_to:N|no_reply_to][in_flight:K]
```
These give the model context that pure text would not — "yes" with 1 proposal in flight is APPROVE; "yes" with 3 in flight and no quote-reply is structurally ambiguous and trained as UNCLEAR.
The prefix is concatenated into the input string and tokenized as regular subword pieces — no special-token registration required.
## Variation dimensions
Each of the 1,047 human-written seeds expands to ~24 training rows via two stacked variation axes:
**1. Surface variants (6 per seed, randomly sampled):**
- Case: lowercase / title / uppercase / as_is
- Punctuation: none / `.` / `!` / `?`
- Whitespace: none / leading 2 spaces / trailing 2 spaces
**2. Structural prefix variants (4 per surface form):**
- `(reply_to: present, in_flight: 1)`
- `(reply_to: present, in_flight: 2)`
- `(reply_to: present, in_flight: 3)`
- `(reply_to: absent, in_flight: 1)` — single-default rule
Additionally, the UNCLEAR class includes **480 template-generated rows** using a 100-ticker pool (mega-caps, ETFs, ADRs, mid-caps, speculative names) and 20 multi-intent templates ("approve {A} not {B}", "yes {A} no {B}", "swap {A} for {B}", etc.). This teaches the model the multi-intent PATTERN across diverse ticker tokens without bias toward any specific ticker. The model generalizes to ticker pairs it has never seen in training.
## Zero-leakage verification
Eval phrases are NEVER present in training:
```python
import json
training_seeds = set(
json.loads(l)["seed"].strip().lower()
for l in open("training.jsonl")
)
overlaps = sum(
1 for l in open("eval.jsonl")
if json.loads(l)["raw_text"].strip().lower() in training_seeds
)
assert overlaps == 0
```
This is enforced on every regeneration. The eval set's adversarial value depends on the model learning patterns it can generalize to novel phrasings, not memorizing surface forms.
## Design decisions
**Author-written seeds, not LLM-generated.** The 1,047 seed phrases reflect natural reply phrasings a human would actually type — short, casual, sometimes with typos, sometimes with adjacency to system commands. Seeds were hand-written and iteratively reviewed against eval failures.
**Programmatic augmentation, not LLM expansion.** Surface variation is deterministic — case/punctuation/whitespace flipping plus structural-prefix combinations. No language model generates content. This keeps the dataset auditable and reproducible.
**Six labels with COUNTER_PRICE separated from COUNTER_SIZE.** Earlier prototypes used five labels. The sixth (COUNTER_PRICE) was added because resize ("size 10") and reprice ("at $49") require different downstream extraction — share count vs limit price — and conflating them would force the consumer to disambiguate post-classification.
**Balanced classes by design.** All classes are within 4,080–4,608 rows (~13% spread). Class weighting in training becomes functionally uniform, simplifying the training loss and removing a configuration knob.
**Eval set adversarial-leaning.** The held-out 175 examples lean toward edge cases that surfaced during iterative training — casual register ("yup", "yeppers"), action metaphors ("press the button"), negation-as-deferral ("not now", "dont fire yet"), and multi-intent ambiguity ("yes but actually no"). Easy canonical examples are under-represented in eval intentionally.
## Intended downstream task
Train a classifier that routes short free-form text replies on trade proposals into one of 6 action intents:
```
APPROVE execute as proposed
DECLINE kill the proposal
HOLD defer the decision
COUNTER_SIZE execute at a different share count
COUNTER_PRICE execute at a different limit price
UNCLEAR cannot safely commit (refuse)
```
The data assumes the consumer pairs the model with a confidence threshold, deterministic safety rails (budget/position limits), and a fallback confirmation mechanism. The dataset is NOT intended for standalone-classifier deployments without those layers.
## Loading
```python
from datasets import load_dataset
ds = load_dataset("DoDataThings/trade-decision-classifier-v1-dataset")
ds["train"] # 25,200 rows
ds["test"] # 175 rows (held out, used for eval — never trained on)
```
Or directly:
```python
import json
train = [json.loads(l) for l in open("training.jsonl")]
test = [json.loads(l) for l in open("eval.jsonl")]
```
## Trained model
A reference classifier trained on this dataset: [DoDataThings/distilbert-trade-decision-classifier-v1](https://huggingface.co/DoDataThings/distilbert-trade-decision-classifier-v1). Reaches macro F1 0.954 on the held-out eval set with zero high-confidence misclassifications.
## Limitations
- **Surface coverage.** The 1,047 human-written seeds reflect representative reply phrasings curated through 12 training iterations against an adversarial eval set. Real production replies will still exceed seed coverage on long-tail phrasing; expect ~5% of replies to land at the confidence floor and route to confirmation fallback.
- **Class boundaries on multi-intent inputs** ("approve but cut size") are ambiguous; eval labels reflect a single curator's judgment.
- The "more shares" eval row is architecturally ambiguous (resize intent without a number) — a model trained on this dataset will correctly emit UNCLEAR rather than COUNTER_SIZE, which is safe behavior but reads as a miss against the eval label.
- **English-only.** No localization in v1.
## License
Apache 2.0.