CoolFace
Datasetpublic

Jaymerry/french-administrative-hierarchy-data-quality

French Administrative Hierarchy Data Quality Benchmark A reproducible benchmark for evaluating the validation, classification, and repair of French administrative geographic records. The dataset is derived from the INSEE Code officiel géographique (COG) 2026 and focuses on the hierarchical relationship: Region → Department → Commune Important: commune_code is an INSEE/COG administrative identifier, not a postal code.This dataset is not intended for postal-address validation or… See the full description on the dataset page: https://huggingface.co/datasets/Jaymerry/french-administrative-hierarchy-data-quality.

sourceHugging Faceetalab-2.0updated 2mo agoView on Hugging Face
0likes132downloads
Dataset Card

French Administrative Hierarchy Data Quality Benchmark

A reproducible benchmark for evaluating the validation, classification, and repair of French administrative geographic records.

The dataset is derived from the INSEE Code officiel géographique (COG) 2026 and focuses on the hierarchical relationship:

text
Region → Department → Commune
Important: commune_code is an INSEE/COG administrative identifier, not a postal code. This dataset is not intended for postal-address validation or postal-code prediction.

image


1. What the dataset models

Each source record represents a canonical French administrative path:

text
Region → Department → Commune

Example:

text
Auvergne-Rhône-Alpes (84)
└── Rhône (69)
    └── Lyon (69123)

The benchmark evaluates whether the codes and labels in a record form a valid and internally consistent administrative hierarchy.

A record may contain values that are individually valid but incorrectly combined. For example:

text
Region:      Auvergne-Rhône-Alpes (84)
Department:  Isère (38)
Commune:     Lyon (69123)

Department 38 and commune code 69123 both exist, but Lyon does not belong to Isère. The anomaly is therefore hierarchical, rather than purely syntactic.

The word hierarchy refers here to administrative and geographic membership. It does not imply organizational ownership or historical lineage.

image


2. Record structure

The input-oriented fields are the corrupted_* columns. The clean_* columns and evaluation labels describe the expected canonical record.

Core fields include:

FieldDescription
source_record_idStable identifier of the source commune
clean_region_codeCanonical COG region code
clean_department_codeCanonical COG department code
clean_commune_codeCanonical COG commune code
clean_nameOfficial commune name
corrupted_region_codeRegion code presented to the model
corrupted_department_codeDepartment code presented to the model
corrupted_commune_codeCommune code presented to the model
corrupted_nameCommune name presented to the model
is_canonicalWhether the presented record exactly matches the canonical form
has_integrity_errorWhether the record contains an identifier or cross-field integrity error
quality_statusSemantic quality category
error_typeSynthetic alteration applied
affected_fieldField expected to be repaired
expected_valueCanonical value for the affected field
corrupted_valueAltered value
difficultyHeuristic difficulty level
splitAvailable in local generation metadata; omitted from exported split files

Example

Canonical record:

json
{
  "region_code": "84",
  "department_code": "69",
  "commune_code": "69123",
  "commune_name": "Lyon"
}

Altered record:

json
{
  "region_code": "84",
  "department_code": "38",
  "commune_code": "69123",
  "commune_name": "Lyon",
  "quality_status": "inconsistent",
  "error_type": "mismatched_department",
  "affected_field": "department_code",
  "expected_value": "69",
  "corrupted_value": "38"
}

image


3. Quality statuses

The benchmark distinguishes exact canonical form from actual integrity failures.

StatusMeaning
canonicalExact official COG form
non_canonicalSimplified spelling, such as removed accents or hyphens
inconsistentExisting values combined in a way that conflicts with the canonical record or hierarchy
invalid_identifierIdentifier absent from the COG 2026 reference

This distinction matters because a spelling such as Saint-Etienne may be non-canonical without being unusable in every information system.

has_integrity_error is therefore stricter than is_canonical.


4. Main error types

Error typeError familyDescription
noneCanonicalUnaltered official record
remove_accentsCanonicalizationRemoves diacritics from the commune name
remove_hyphensCanonicalizationReplaces hyphens with spaces
character_swapText qualitySwaps adjacent characters in the commune name
mismatched_departmentHierarchical consistencyAssociates the commune with another valid department
unknown_commune_codeReferential integrityGenerates a commune code absent from the reference
mismatched_commune_codeEntity consistencyUses an existing code belonging to another commune

Why the distinction between unknown and mismatched codes matters

  • unknown_commune_code: the identifier does not exist in COG 2026.
  • mismatched_commune_code: the identifier exists, but it does not identify the commune named in the record.

The second task requires entity-level consistency checking rather than a simple lookup.

image


5. What the benchmark evaluates

The dataset supports several evaluation tasks:

  1. 1.Canonical-form detection Determine whether the presented record exactly matches the official form.
  1. 1.Integrity-error detection Identify records containing invalid identifiers or cross-field inconsistencies.
  1. 1.Error-type classification Classify the synthetic anomaly.
  1. 1.Affected-field identification Determine which field should be repaired.
  1. 1.Hierarchical consistency checking Verify the administrative path Region → Department → Commune.
  1. 1.Referential-integrity validation Check whether identifiers exist in the official reference.
  1. 1.Value repair Recover the expected canonical value.

Suggested metrics

For binary detection:

  • Precision
  • Recall
  • F1
  • Matthews correlation coefficient

For error classification:

  • Macro-F1
  • Per-class precision and recall
  • Confusion matrix

For repair:

  • Exact repair accuracy
  • Field-level accuracy
  • Character error rate for commune names

Results should be reported by both error_type and difficulty.

image


6. Dataset configurations

full

Contains the complete generated distribution, including canonical records, spelling variants, and integrity errors.

Recommended for:

  • exploratory analysis;
  • multi-task learning;
  • studying the natural distribution produced by the generator.

integrity_only

Excludes simple non_canonical spelling variants.

Recommended for:

  • strict administrative consistency checking;
  • referential-integrity validation;
  • hierarchical anomaly detection.

binary_balanced

Contains one canonical and one altered record per source commune.

Recommended for:

  • balanced canonical-versus-altered classification;
  • baseline binary models;
  • controlled model comparison.

error_type_balanced

Balances each error type independently inside each split.

Recommended for:

  • multiclass benchmarking;
  • macro-F1 comparison;
  • reducing majority-class effects.

image


7. Typical use cases

Potential applications include:

  • data-quality pipelines;
  • ETL and ELT validation;
  • master-data management;
  • entity resolution;
  • record linkage;
  • referential-integrity testing;
  • anomaly detection;
  • tabular machine-learning benchmarks;
  • LLM and agent evaluation on structured records;
  • automated repair suggestions.

This benchmark is particularly relevant when a system must reason over the combination of several valid fields rather than validate each field independently.

image

image


Loading the dataset

Default configuration

python
from datasets import load_dataset

dataset = load_dataset(
    "Jaymerry/french-administrative-hierarchy-data-quality"
)

print(dataset)
print(dataset["train"][0])

Select a configuration

python
from datasets import load_dataset

dataset = load_dataset(
    "Jaymerry/french-administrative-hierarchy-data-quality",
    "integrity_only",
)

Available configurations:

text
full
integrity_only
binary_balanced
error_type_balanced

Load the auxiliary JSONL files

Parquet files under data/ are the files configured for the Hugging Face Dataset Viewer.

Equivalent human-readable JSONL files may be provided under jsonl/:

python
from datasets import load_dataset

dataset_jsonl = load_dataset(
    "json",
    data_files={
        "train": (
            "hf://datasets/"
            "Jaymerry/french-administrative-hierarchy-data-quality/"
            "jsonl/full/train.jsonl"
        ),
        "validation": (
            "hf://datasets/"
            "Jaymerry/french-administrative-hierarchy-data-quality/"
            "jsonl/full/validation.jsonl"
        ),
        "test": (
            "hf://datasets/"
            "Jaymerry/french-administrative-hierarchy-data-quality/"
            "jsonl/full/test.jsonl"
        ),
    },
)

Splits and leakage prevention

Splits are assigned at the source-record level using a deterministic hash.

All variants generated from the same commune remain in the same split. This prevents a model from seeing one altered version of a commune during training and another version of the same commune during evaluation.

The available splits are:

text
train
validation
test

Source and provenance

  • Producer: Institut national de la statistique et des études économiques (INSEE)
  • Source: Code officiel géographique au 1 January 2026
  • Source file: v_commune_2026.csv
  • Original license: Licence Ouverte / Open Licence 2.0
  • Dataset license: etalab-2.0
  • Generation seed: 42

The source is filtered to records where TYPECOM == "COM".

All alterations in this benchmark are generated synthetically. They must not be interpreted as errors present in the original INSEE data.

The repository includes generation and validation scripts as well as source and quality manifests for reproducibility.


Limitations

  • The benchmark represents the COG 2026 snapshot and does not automatically reflect later administrative changes.
  • The alterations are synthetic and do not cover every real-world data-entry process.
  • Difficulty labels are heuristic.
  • Accentless or hyphenless forms are labelled non_canonical, not universally invalid.
  • The current version focuses mainly on commune identifiers, commune names, and department consistency.
  • Region and department names may not yet be included as explicit columns.
  • This dataset is not intended for postal routing, postal-code validation, address geocoding, or operational administrative decisions.
  • The dataset must not replace the current official INSEE reference.

Responsible use

Appropriate uses include research, benchmarking, education, and development of data-quality systems.

Users should verify results against the latest official reference before applying corrections to production administrative data.


Reproducibility

The repository may include:

text
scripts/build_dataset_v2.py
scripts/validate_dataset_v2.py
metadata/source_manifest_2026.json
metadata/quality_report_v2.json
metadata/validation_report.json

The source manifest records the retrieval date and SHA-256 checksum of the original source file.


Citation

No formal paper is currently associated with this dataset.

When using it, please cite:

  1. 1.the INSEE Code officiel géographique source;
  2. 2.this Hugging Face dataset repository.

Suggested citation:

bibtex
@dataset{merry_2026_french_administrative_hierarchy,
  author       = {Jeremy Banchet (Jaymerry)},
  title        = {French Administrative Hierarchy Data Quality Benchmark},
  year         = {2026},
  publisher    = {Hugging Face},
  url          = {https://huggingface.co/datasets/Jaymerry/french-administrative-hierarchy-data-quality}
}

License

The dataset is distributed under the Licence Ouverte / Open Licence 2.0, represented on Hugging Face by:

text
etalab-2.0

See SOURCES.md and the source manifest for detailed attribution and provenance.