Datasets:
id large_stringlengths 20 20 | label large_stringclasses 27
values | incl_prob float64 0.3 1 | stratum large_stringclasses 27
values | cluster large_stringclasses 112
values | unsure bool 1
class |
|---|---|---|---|---|---|
moc:1111001111010101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111010901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111011901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111012901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111013001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111013101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111013201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111013301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111013401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111013501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111013601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001111020101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010202 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010302 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010303 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121010901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121011901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121012901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121013901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014402 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121014901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015001 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015101 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015201 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015301 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015401 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015501 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015601 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015701 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015801 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121015901 | 11110 | 1 | 11110 | 1111001 | false |
moc:1111001121016001 | 11110 | 1 | 11110 | 1111001 | false |
cpilens: reference set and Thai CPI taxonomy
The evaluation labels and taxonomy tables of the paper How much does product classification cost in basis points?. The paper classifies Thai product text into the items of the Thai consumer price index (base 2566 / 2023), then measures what the classifier's errors do to measured inflation.
📄 Paper · 💻 Code · 🤗 Model · 🔖 DOI 10.5281/zenodo.23686886
The official specification text is not in this dataset. The reference set holds ids, item codes and the sampling design. The Thai government source pages state no licence, so the project does not redistribute their files. See Getting the text.
No training corpus is published here. make data in the code repository rebuilds it from the
public sources, with checksums.
Contents
Each CSV file is copied unchanged from commit
1186432 of the code repository, at the same path. The
configs load parquet/<config>.parquet, which holds the same rows with the column types listed
under Fields, so codes such as 00000 keep their leading zeros.
| Config | File | Rows | Content | Licence |
|---|---|---|---|---|
reference_set |
data/reference_set.csv |
3,910 | The held-out evaluation rows of the paper: ids, labels and the sampling design. | Attribution, non-commercial research use (no upstream licence stated) |
gold_sample |
data/gold/sample.csv |
600 | Thai-market Open Food Facts products drawn for hand labelling. It has no labels and was not used in this version. | ODbL 1.0 |
item_scope |
taxonomy/thcpi_scope.csv |
29 | The classifier's label set: the in-scope CPI items and their COICOP 2018 class. | MIT |
category_crosswalk |
taxonomy/off_categories_to_thcpi.csv |
119 | Crosswalk from Open Food Facts category tags to CPI items, which gives the weak labels. | ODbL 1.0 |
aggregate_weights |
taxonomy/thcpi_weights_2566.csv |
29 | Official aggregate weights recovered from TPSO's monthly releases, base 2566 (2023). | MIT for the derivation; the official figures are TPSO's (no upstream licence stated) |
item_weights |
taxonomy/thcpi_leaf_weights_2566.csv |
111 | Item weights. Item weights inside an official cell are estimates, not official figures. | MIT for the derivation; the official figures are TPSO's (no upstream licence stated) |
aggregate_codes |
taxonomy/thcpi_weight_aggregates.csv |
29 | The aggregates in TPSO's weight table, in the order of the table. | MIT for the derivation; the official figures are TPSO's (no upstream licence stated) |
source_manifest |
data/manifest.csv |
28 | URL and SHA-256 of every raw source file, which make data checks on download. |
MIT |
Use
from datasets import load_dataset
ref = load_dataset("thanatchon36/cpilens-reference-set", split="test") # the reference set, the default config
scope = load_dataset("thanatchon36/cpilens-reference-set", "item_scope", split="train")
The reference set
- Source: the price-collection specifications the Ministry of Commerce publishes as open data, each under the official item code TPSO uses.
- Rows: 2,410 held-out specifications of 26 in-scope items, all kept, and 1,500 held-out out-of-scope specifications in a fixed hash-ordered sample.
- Weighting: weight each row by
1 / incl_prob, so estimates refer to the whole held-out list. - Split: whole sub-items are held out inside every item. A fifth of an item's sub-items, at least one, are test.
- Coverage: 2 of the 28 in-scope items have no specifications in the published file and cannot be evaluated. Items with few specifications have wide intervals.
- Not sealed: cascade thresholds and classifier settings were chosen on the training and validation splits only, but the development grid logged reference scores for every run. They were visible during development.
For intervals, resample whole cluster values within each stratum. The errors of a method
cluster within sub-items.
Getting the text
Scoring a saved prediction needs only this dataset. To run a classifier on the specifications, build them from the source:
git clone https://github.com/thanatchon36/cpilens && cd cpilens
uv sync && make data
data/interim/moc_specs.parquet then holds the text. A row's id here is moc: plus that file's
spec_id. If an upstream file has changed since this release, the build stops at the checksum
check.
Limitations
- Specifications are the statistical office's own short descriptions, not shop or web listings.
- Open Food Facts is crowd-sourced, and its Thai products served as a development set only.
- There are no prices. The data support classification, not index compilation.
- This is not an official classification. Do not use it as, or to infer, any statistical office's or central bank's internal data or methods.
Licences and attribution
The licence is set per file, as in the table above. The paper's data sources give every source's URL, retrieval date, licence and checksum.
- Open Food Facts and Open Beauty Facts: © Open Food Facts contributors, https://world.openfoodfacts.org, under the Open Database License 1.0. A database derived from these files must carry the same licence.
- Thai government sources: Ministry of Commerce open data, and Trade Policy and Strategy Office (TPSO) publications. Their pages state no licence, so this project treats them under attribution and non-commercial research use.
- COICOP 2018: © United Nations. Class codes and titles are cited.
Fields
reference_set
| Column | Type | Meaning |
|---|---|---|
id |
string | moc: plus the official 16-digit specification code |
label |
string | TPSO item code of the in-scope item, or OOS |
incl_prob |
float64 | Inclusion probability; weight a row by its inverse |
stratum |
string | Bootstrap stratum: the label |
cluster |
string | Bootstrap cluster: the official 7-digit sub-item |
unsure |
bool | Always false here; kept for the hand-labelling format |
gold_sample
| Column | Type | Meaning |
|---|---|---|
order |
int32 | Labelling order |
barcode |
string | Product barcode |
source |
string | off (Open Food Facts) or obf (Open Beauty Facts) |
stratum |
string | CPI weight cell of the weak label, none or OOS |
incl_prob |
float64 | Inclusion probability within the stratum |
double |
bool | Selected for a blind second labelling pass |
name_th |
string | Product name in Thai |
name_en |
string | Product name in English, if any |
brands |
string | Brands |
quantity |
string | Quantity as entered |
image_url |
string | Link to the front image (CC BY-SA; not copied here) |
item_scope
| Column | Type | Meaning |
|---|---|---|
label |
string | TPSO item code |
name_th |
string | Item name in Thai |
name_en |
string | Item name in English |
in_scope |
bool | Whether the item is in scope |
scope_group |
string | Group of the item within the scope |
coicop2018 |
string | COICOP 2018 class |
coicop_pages |
string | Pages of the UN classification that give the class |
note |
string | Note on the mapping, if any |
includes |
string | Short description of what the item covers |
category_crosswalk
| Column | Type | Meaning |
|---|---|---|
tag |
string | Open Food Facts category tag |
label |
string | TPSO item code, or OOS |
priority |
int32 | Priority when a product has several matching tags |
basis |
string | Reason for the mapping |
aggregate_weights
| Column | Type | Meaning |
|---|---|---|
code |
string | TPSO aggregate code |
name_en |
string | Aggregate name in English |
kind |
string | Level of the aggregate |
w0 |
float64 | Base weight, the mean across the releases |
w0_spread |
float64 | Largest minus smallest w0 across the releases |
w_pr |
float64 | Price-updated weight share, as used in the paper |
release_months_be |
string | Releases used, in Buddhist Era years |
price_ref_be |
string | Price reference month, in Buddhist Era years |
item_weights
| Column | Type | Meaning |
|---|---|---|
leaf |
string | TPSO item code |
name_th |
string | Item name in Thai |
cell |
string | Official node whose weight the item shares |
residual_cell |
bool | Whether official nodes are nested below that node |
cell_weight |
float64 | Weight of the cell |
w_equal |
float64 | Estimated item weight: equal split of the cell |
w_nnls |
float64 | Estimated item weight: non-negative least squares |
aggregate_codes
| Column | Type | Meaning |
|---|---|---|
row |
int32 | Row in the published table |
code |
string | TPSO aggregate code |
name_en |
string | Aggregate name in English |
kind |
string | Level of the aggregate |
source_manifest
| Column | Type | Meaning |
|---|---|---|
path |
string | Path under data/raw/ |
url |
string | Source URL |
sha256 |
string | SHA-256 of the file |
Citation
@misc{chongmankhong2026cpilens,
author = {Chongmankhong, Thanatchon},
title = {How much does product classification cost in basis points?
Multilingual classification of Thai product text for consumer price measurement},
year = {2026},
doi = {10.5281/zenodo.23686886},
url = {https://thanatchon36.github.io/cpilens/paper/}
}
The views expressed are the author's own and do not necessarily reflect those of the Bank of Thailand. This work uses only publicly available data. This is independent work, not a BIS, ECB or Bank of Thailand publication.
- Downloads last month
- 59