Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
csv
Languages:
English
Size:
10K - 100K
License:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -16,25 +16,22 @@ size_categories:
|
|
| 16 |
|
| 17 |
# US Bank Transaction Categories v2 — Synthetic Dataset
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
| **Categories** | 16 (includes Housing) | 16 (Housing split into Rent + Mortgage removed) |
|
| 27 |
-
| **Samples** | 16,000 (1,000/category) | 24,000 (1,500/category) |
|
| 28 |
-
| **Merchants** | ~300 | ~500+ |
|
| 29 |
-
| **PayPal wrappers** | Few categories | All spending categories (8% of samples) |
|
| 30 |
-
| **POS prefixes** | SQ* | SQ*, TST* (Toast), CLV* (Clover) |
|
| 31 |
-
| **Transfer patterns** | Basic P2P + CC payments | + brokerage sweeps, fintech, wire, cashier's checks, ATM, crypto, BNPL |
|
| 32 |
|
| 33 |
-
## Why Sign Prefixes
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
Sign distributions per category reflect real-world patterns
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Format
|
| 40 |
|
|
@@ -43,44 +40,62 @@ CSV with two columns:
|
|
| 43 |
```
|
| 44 |
description,category
|
| 45 |
"[debit] AMAZON MKTPL*K8R2M5VN7","Shopping"
|
| 46 |
-
"[credit]
|
| 47 |
-
"[debit]
|
| 48 |
-
"[debit] SCHWAB MONEYLINK PPD ID:
|
| 49 |
"[credit] AUTOMATIC PAYMENT - THANK","Transfer"
|
| 50 |
-
"[debit]
|
|
|
|
| 51 |
```
|
| 52 |
|
| 53 |
-
## Categories (
|
| 54 |
|
| 55 |
| Category | Count | Examples |
|
| 56 |
|----------|-------|----------|
|
| 57 |
-
| Restaurants |
|
| 58 |
-
| Groceries |
|
| 59 |
-
| Shopping |
|
| 60 |
-
| Transportation |
|
| 61 |
-
| Entertainment |
|
| 62 |
-
| Utilities |
|
| 63 |
-
| Subscription |
|
| 64 |
-
| Healthcare |
|
| 65 |
-
| Insurance |
|
| 66 |
-
|
|
| 67 |
-
|
|
| 68 |
-
|
|
| 69 |
-
|
|
| 70 |
-
|
|
| 71 |
-
|
|
| 72 |
-
|
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
## Variation Dimensions
|
| 86 |
|
|
@@ -88,20 +103,21 @@ description,category
|
|
| 88 |
- **Spacing:** normal, extra-padded (ACH style), compressed
|
| 89 |
- **Store numbers:** `#1234`, `1234`, `#01234`, absent
|
| 90 |
- **Order IDs:** `*ORDERID` (Amazon style)
|
| 91 |
-
- **POS prefixes:** `SQ *`
|
|
|
|
| 92 |
- **Addresses:** full, partial, zip-smashed-into-city (Apple Card quirk)
|
|
|
|
| 93 |
- **Cities:** 36 US cities across multiple states
|
| 94 |
-
- **Sign prefixes:** `[debit]`
|
| 95 |
-
- **Abbreviated merchant names:** real bank statement abbreviations
|
| 96 |
|
| 97 |
## Design Decisions
|
| 98 |
|
| 99 |
-
- **No "
|
| 100 |
- **No "Business" category.** Whether a transaction is a business expense depends on the _account_, not the description.
|
| 101 |
-
- **Transfer vs Income.**
|
| 102 |
-
- **Subscription vs Shopping.** `Amazon.com*ORDERID` = Shopping. `AMAZON WEB SERVICES` = Subscription. `X CORP. PAID FEATURES` = Subscription. `TIKTOK SHOP` = Shopping.
|
| 103 |
-
- **
|
| 104 |
-
- **Balanced classes.**
|
| 105 |
|
| 106 |
## Usage
|
| 107 |
|
|
@@ -115,14 +131,14 @@ print(ds["train"][0])
|
|
| 115 |
|
| 116 |
## Trained Model
|
| 117 |
|
| 118 |
-
A DistilBERT model fine-tuned on this dataset is available at [DoDataThings/distilbert-us-transaction-classifier-v2](https://huggingface.co/DoDataThings/distilbert-us-transaction-classifier-v2).
|
| 119 |
|
| 120 |
## Generator
|
| 121 |
|
| 122 |
-
The synthetic data generator
|
| 123 |
|
| 124 |
```bash
|
| 125 |
-
node scripts/generate-training-data.js --count
|
| 126 |
```
|
| 127 |
|
| 128 |
Available at [github.com/wnstnb/foliome](https://github.com/wnstnb/foliome).
|
|
|
|
| 16 |
|
| 17 |
# US Bank Transaction Categories v2 — Synthetic Dataset
|
| 18 |
|
| 19 |
+
68,000 sign-prefixed transaction descriptions across 17 spending categories, modeled after real US bank statement formats. Designed for training classifiers that work on actual bank data — not the clean `"Starbucks coffee"` descriptions that most datasets use.
|
| 20 |
|
| 21 |
+
**Successor to [v1](https://huggingface.co/datasets/DoDataThings/us-bank-transaction-categories).**
|
| 22 |
|
| 23 |
+
## Why This Dataset
|
| 24 |
+
|
| 25 |
+
Real bank transaction data is private. But the _formats_ are universal — Chase, Apple Card, PayPal, Capital One, Mercury all produce descriptions with predictable structures. This dataset captures those structures with 500+ real merchant names, randomized store numbers, addresses, and reference codes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
### Why Sign Prefixes
|
| 28 |
|
| 29 |
+
Bank transaction descriptions are ambiguous without direction. "VENMO CASHOUT" as a credit is income — as a debit it's a transfer. `[debit]`/`[credit]` encodes the cardholder's perspective so the model can disambiguate.
|
| 30 |
|
| 31 |
+
Sign distributions per category reflect real-world patterns:
|
| 32 |
+
- Spending categories: 95%+ debit
|
| 33 |
+
- Income: 97% credit
|
| 34 |
+
- Transfer: 50/50 (bidirectional by nature)
|
| 35 |
|
| 36 |
## Format
|
| 37 |
|
|
|
|
| 40 |
```
|
| 41 |
description,category
|
| 42 |
"[debit] AMAZON MKTPL*K8R2M5VN7","Shopping"
|
| 43 |
+
"[credit] Patelco CU PAYROLL PPD ID: 321076470","Income"
|
| 44 |
+
"[debit] PreApproved Payment Bill User Payment: Netflix","Subscription"
|
| 45 |
+
"[debit] SCHWAB BROKERAGE MONEYLINK PPD ID: 9005586224","Transfer"
|
| 46 |
"[credit] AUTOMATIC PAYMENT - THANK","Transfer"
|
| 47 |
+
"[debit] PP*SAFEWAY","Groceries"
|
| 48 |
+
"[debit] TST*GOLDEN DRAGON - OAKLAND","Restaurants"
|
| 49 |
```
|
| 50 |
|
| 51 |
+
## Categories (17)
|
| 52 |
|
| 53 |
| Category | Count | Examples |
|
| 54 |
|----------|-------|----------|
|
| 55 |
+
| Restaurants | 4,000 | `TST*SAKURA SUSHI`, `DAVESHOTCHICKEN`, `CLV*BURGER JOINT`, `PP*CHIPOTLE` |
|
| 56 |
+
| Groceries | 4,000 | `SAFEWAY #1197`, `WHOLEFDS FRE #10467`, `PYPL*TRADER JOE'S`, `365 MARKET` |
|
| 57 |
+
| Shopping | 4,000 | `Amazon.com*K8R2M5VN7`, `TIKTOK SHOP`, `Express Checkout Payment: TARGET`, `TOTAL WINE` |
|
| 58 |
+
| Transportation | 4,000 | `CHEVRON 0385291`, `CHARGEPOINT *STATION 1234`, `COSTCO GAS #1061`, `CA DMV FEE` |
|
| 59 |
+
| Entertainment | 4,000 | `VALVE STEAM PURCHASE`, `DRAFTKINGS SPORTSBOOK`, `PreApproved Payment: Valve Corp.` |
|
| 60 |
+
| Utilities | 4,000 | `PG&E`, `PGANDE WEB ONLINE`, `REPUBLIC SERVICES TRASH`, `SUNRUN SOLAR` |
|
| 61 |
+
| Subscription | 4,000 | `CURSOR USAGE`, `X CORP. PAID FEATURES`, `PYPL*NETFLIX`, `SALESFORCE; Billing` |
|
| 62 |
+
| Healthcare | 4,000 | `TELADOC TELEHEALTH`, `KAISER PERMANENTE`, `PP*ASPEN DENTAL`, `BETTERHELP` |
|
| 63 |
+
| Insurance | 4,000 | `FARMERS INS BILLING`, `HOMESERVE USA`, `PreApproved Payment: STATE FARM` |
|
| 64 |
+
| Mortgage | 4,000 | `ROCKET MORTGAGE`, `PATELCO CU MORTGAGE`, `SOFI MORTGAGE PAYMENT`, `Principal Pmt` |
|
| 65 |
+
| Rent | 4,000 | `EQUITY RESIDENTIAL RENT PAYMENT`, `GREYSTAR LEASE PAYMENT` |
|
| 66 |
+
| Travel | 4,000 | `ROYAL CARIBBEAN`, `TSA PRECHECK`, `SWA INFLIGHT WIFI`, `MARRIOTT` |
|
| 67 |
+
| Education | 4,000 | `COURSERA`, `Express Checkout Payment: Scholastic Inc`, `BRILLIANT.ORG` |
|
| 68 |
+
| Personal Care | 4,000 | `SPORT CLIPS`, `SEPHORA`, `360 FITNESS LLC`, `TST*ISLAND VINTAGE SHAVE` |
|
| 69 |
+
| Transfer | 4,000 | `COINBASE ACH TRANSFER`, `WIRE TRANSFER TO NAME`, `ATM DEPOSIT`, `DDA TO DDA` |
|
| 70 |
+
| Income | 4,000 | `PAYROLL PPD ID:`, `SSA TREAS 310 FED SAL`, `DOORDASH DASHERPAY` |
|
| 71 |
+
| Fees | 4,000 | `OVERDRAFT FEE`, `ATM SURCHARGE`, `PAPER STATEMENT FEE` |
|
| 72 |
+
|
| 73 |
+
## Eight Bank Statement Formats
|
| 74 |
+
|
| 75 |
+
Every spending category produces descriptions in all major US bank formats:
|
| 76 |
+
|
| 77 |
+
| Format | Structure | Banks |
|
| 78 |
+
|---|---|---|
|
| 79 |
+
| **Chase ACH** | `INSTITUTION PURPOSE PPD/WEB ID: CODE` | Chase checking |
|
| 80 |
+
| **Chase merchant** | `MERCHANT #STORE` or `MERCHANT*ORDERID` | Chase credit cards |
|
| 81 |
+
| **Apple Card** | `MERCHANT ADDRESS CITY ZIP STATE COUNTRY` | Apple Card |
|
| 82 |
+
| **PayPal** | `PreApproved Payment: MERCHANT`, `PP*`, `PYPL*`, `PAYPAL *`, `INST XFER` | PayPal (as card issuer) |
|
| 83 |
+
| **Capital One** | `Withdrawal from MERCHANT`, `Preauthorized Deposit from MERCHANT` | Capital One |
|
| 84 |
+
| **Mercury** | `MERCHANT; Description` or just `MERCHANT` | Mercury, neobanks |
|
| 85 |
+
| **POS** | `SQ *MERCHANT`, `TST*MERCHANT`, `CLV*MERCHANT` | Square, Toast, Clover |
|
| 86 |
+
| **Simple** | `MERCHANT`, `MERCHANT.COM`, `MERCHANT INC.` | Various |
|
| 87 |
+
|
| 88 |
+
### PayPal as a Bank Format
|
| 89 |
+
|
| 90 |
+
PayPal isn't just a payment wrapper — it's a card issuer. People use PayPal credit/debit cards at any merchant. This dataset treats PayPal formats as first-class bank statement structures:
|
| 91 |
+
|
| 92 |
+
- `PreApproved Payment Bill User Payment: STARBUCKS` → Restaurants
|
| 93 |
+
- `PP*SAFEWAY` → Groceries
|
| 94 |
+
- `PYPL*NETFLIX` → Subscription
|
| 95 |
+
- `Express Checkout Payment: TARGET` → Shopping
|
| 96 |
+
- `PAYPAL INST XFER MEDIUM.COM WEB ID: PAYPALSI77` → Subscription
|
| 97 |
+
|
| 98 |
+
PayPal-formatted descriptions appear in all spending categories at realistic rates (5-15% of samples).
|
| 99 |
|
| 100 |
## Variation Dimensions
|
| 101 |
|
|
|
|
| 103 |
- **Spacing:** normal, extra-padded (ACH style), compressed
|
| 104 |
- **Store numbers:** `#1234`, `1234`, `#01234`, absent
|
| 105 |
- **Order IDs:** `*ORDERID` (Amazon style)
|
| 106 |
+
- **POS prefixes:** `SQ *`, `TST*`, `CLV*`
|
| 107 |
+
- **PayPal prefixes:** `PP*`, `PYPL*`, `PAYPAL *`, `PreApproved Payment`, `Express Checkout`
|
| 108 |
- **Addresses:** full, partial, zip-smashed-into-city (Apple Card quirk)
|
| 109 |
+
- **Compressed names:** `DAVESHOTCHICKEN`, `CHICKFILA`, `WHOLEFDS FRE`, `TRADERJOES`
|
| 110 |
- **Cities:** 36 US cities across multiple states
|
| 111 |
+
- **Sign prefixes:** `[debit]`/`[credit]` with category-appropriate distributions
|
|
|
|
| 112 |
|
| 113 |
## Design Decisions
|
| 114 |
|
| 115 |
+
- **No "Housing" category.** Split into Mortgage (model-classified) and Rent (model-classified). Home maintenance → Shopping.
|
| 116 |
- **No "Business" category.** Whether a transaction is a business expense depends on the _account_, not the description.
|
| 117 |
+
- **Transfer vs Income uses sign.** `[credit] VENMO CASHOUT` = Income. `[debit] VENMO PAYMENT TO` = Transfer. The sign prefix is the primary disambiguator.
|
| 118 |
+
- **Subscription vs Shopping uses format cues.** `Amazon.com*ORDERID` = Shopping. `AMAZON WEB SERVICES` = Subscription. `X CORP. PAID FEATURES` = Subscription. `TIKTOK SHOP` = Shopping.
|
| 119 |
+
- **500+ real merchants** across restaurants (including culturally diverse cuisines), groceries, SaaS/AI tools, fintech platforms, crypto brokerages, EV charging, gambling/sportsbooks, and more.
|
| 120 |
+
- **Balanced classes.** 4,000 samples per category prevents the classifier from defaulting to the most common class.
|
| 121 |
|
| 122 |
## Usage
|
| 123 |
|
|
|
|
| 131 |
|
| 132 |
## Trained Model
|
| 133 |
|
| 134 |
+
A DistilBERT model fine-tuned on this dataset is available at [DoDataThings/distilbert-us-transaction-classifier-v2](https://huggingface.co/DoDataThings/distilbert-us-transaction-classifier-v2) — 99.9% validation accuracy, 96% of real-world classifications at 0.90+ confidence.
|
| 135 |
|
| 136 |
## Generator
|
| 137 |
|
| 138 |
+
The synthetic data generator is open source:
|
| 139 |
|
| 140 |
```bash
|
| 141 |
+
node scripts/generate-training-data.js --count 4000 # 4,000 per category
|
| 142 |
```
|
| 143 |
|
| 144 |
Available at [github.com/wnstnb/foliome](https://github.com/wnstnb/foliome).
|