liri-uzh/cfpb-complaints-mini
CFPB Complaints — mini (teaching subset) A small, class-capped subset of the CFPB Consumer Complaint Database for teaching text classification. The task: given a consumer's complaint narrative (text), predict the financial product (label). Multiclass, single-label. This is a teaching subsample, not a representative sample of CFPB. It is capped per class, drawn from a fixed date window, and split into a frozen, leak-free test set. Do not present results as CFPB statistics;… See the full description on the dataset page: https://huggingface.co/datasets/liri-uzh/cfpb-complaints-mini.
CFPB Complaints — mini (teaching subset)
A small, class-capped subset of the CFPB Consumer Complaint Database for teaching text classification. The task: given a consumer's complaint narrative (text), predict the financial product (label). Multiclass, single-label.
This is a teaching subsample, not a representative sample of CFPB. It is capped per class, drawn from a fixed date window, and split into a frozen, leak-free test set. Do not present results as CFPB statistics; attribute the CFPB Consumer Complaint Database.
Built for the LiRI/UZH course Python: Introduction to Machine Learning for Text Classification (Session 4 mini project).
Splits and fields
- train: 6469 rows · test: 1635 rows (stratified, frozen, leak-free)
text(string) — the complaint narrativelabel(string) — consolidated product classproduct_raw(string) — the original CFPBProductvalue (provenance)
Classes
bank_account— 2 raw product value(s) merged: Checking or savings account, Bank account or servicecredit_card— 3 raw product value(s) merged: Credit card or prepaid card, Credit card, Prepaid cardcredit_reporting— 3 raw product value(s) merged: Credit reporting, credit repair services, or other personal consumer reports, Credit reporting or other personal consumer reports, Credit reportingdebt_collection— 1 raw product value(s) merged: Debt collectionmoney_transfer— 2 raw product value(s) merged: Money transfer, virtual currency, or money service, Money transfersmortgage— 1 raw product value(s) merged: Mortgagestudent_loan— 1 raw product value(s) merged: Student loan
Class balance (train)
student_loan: 960money_transfer: 960mortgage: 960bank_account: 960debt_collection: 948credit_card: 862credit_reporting: 819
How it was built
- source:
cfpb_api· seed:42· per-class cap:1200· date window: 2022-01-01 to 2023-12-31 - kept only complaints that have a narrative; consolidated ~20 raw products into the classes above; capped per class to bound size and keep the imbalance learnable.
- stratified split; test de-duplicated; any train row whose narrative also appears in test was dropped, so train and test share no identical narrative. Natural duplicates within train are kept on purpose.
Natural characteristics (used as-is, nothing planted)
- Imbalanced — credit reporting dominates. Evaluate with macro-F1.
- Redacted — personal details are masked as
XXXX. - Duplicated — 116 exact-duplicate narratives remain within train (natural re-submissions); test is de-duplicated and disjoint.
- Consumer-selected labels — the original CFPB product is selected by the consumer when submitting the complaint, rather than assigned by an expert annotator. Some complaints involve multiple products or are genuinely ambiguous. CFPB field definitions.
License and attribution
Source: CFPB Consumer Complaint Database (https://www.consumerfinance.gov/data-research/consumer-complaints/), a U.S. federal work in the public domain. This derived subset is released as CC0-1.0. Please attribute the CFPB when using it.
