Skip to content

v1.3.0

Latest

Choose a tag to compare

@rich-iannone rich-iannone released this 12 Nov 01:45
· 77 commits to main since this release
0c50691

Pointblank v1.3.0 is about the quality of the data used to train and evaluate models. The new pb.Ablation measures what each validation step is worth to a model: it retrains the model without the rows that a step flags and compares the result with dropping random rows. col_vals_scored() validates rows by their scores from embedding models, rerankers, classifiers and other models, and new text checks find low-quality text, near-duplicates, benchmark contamination, and personal information. check_splits() and check_synthetic() check dataset splits and synthetic data, and to_data_card() writes a dataset card backed by the validation. The release also makes the null checks treat NaN the same way on every backend and makes the code that to_code() and yaml_to_python() generate more reliable.

New Features

  • Data ablation — pb.Ablation trains your model on the table with each step's failing rows removed, then compares each version with removing the same number of random rows. It reports paired intervals with Holm-adjusted verdicts (helps, hurts or inconclusive). The strategies are drop_each(), drop_steps(), drop_all(), drop_all_but_each() (what each step adds on top of the others), and drop_groups(). There's also a plan() dry run, a compact report, and get_effects() and to_json() for the results. (#534, #535)

  • Ablation for production pipelines — Ablations can be exported, trained elsewhere and read back with export() and load_results(), which check fingerprints of the data and the plan. Results can be cached, run() can run versions in parallel with max_workers= and executor=, and check_determinism() checks that the evaluation is reproducible. annotate() writes the results into the validation's step notes. An ablation can be defined in a YAML ablation: block and built with pb.yaml_ablation(). The new pointblank[ml] extra provides pb.ablation.sklearn_evaluator(), a ready-made scikit-learn evaluate function. (#535)

  • Ablation analyses — sweep_score() and sweep_step() plot a dose-response curve over the cutoffs of a score or the values of a step's parameter. inject() measures what a defect costs the model, and suggest_thresholds() turns that cost into step thresholds. shapley() and get_shapley() divide the effect of cleaning fairly among the steps. ci="bootstrap" gives bootstrap intervals, pass_as="row_index" gives evaluate= the kept row numbers instead of the table, and holdout= validates a holdout set with the same steps. (#536, #537, #540)

  • Model-scored validation — Validate.col_vals_scored() scores each row with a model and checks the score against min_val= and max_val=. The scorer can be any function of a batch of rows, or one of the new pb.scorers adapters: embedding_similarity(), reranker(), classifier(), langid(), perplexity(), text_stat(), and token_count(). Each adapter imports its package only when it's first used. Scores are cached in memory or in an SQLite file that a later run can resume from, and they appear in extracts, step reports and row flags. (#536, #537)

  • Text checks — New validation methods for text data:

    • col_vals_text_quality(): the Gopher heuristic quality filters.
    • col_vals_in_language(): checks the language of the text.
    • col_vals_token_len(): checks the length in tokens.
    • col_vals_no_pii(): finds personal information.
    • rows_near_distinct(): finds near-duplicate rows with MinHash.
    • rows_not_contaminated(): finds text that overlaps with benchmark data.
    • col_vals_chat_format(): finds malformed chat conversations.

    They chain like any other validation method. (#537, #551)

  • RAG checks — pb.rag.corpus_checks() and pb.rag.eval_checks() provide step bundles for retrieval corpora and their evaluation sets. (#538)

  • Split checks — pb.check_splits() checks the splits of a dataset. It finds rows that leak between splits (exact copies and, with near=True, near-copies), labels that a split is missing or doesn't share with the training split, and distribution drift (PSI and KS) for each column. (#537)

  • Synthetic-data checks — pb.check_synthetic() compares synthetic data with the real data it was made from. It checks fidelity (the distribution and missing values of each column), diversity (repeated rows and distinct-n of text), and copies of seed rows. (#538)

  • Data cards — Validate.to_data_card() writes a Hugging Face dataset card or a datasheet, using the validation (and, optionally, an ablation) as evidence of the data's quality. (#538)

  • Multi-judge prompts — prompt() can use several LLM judges and combine their verdicts with aggregate=. calibrate_prompt() measures a step's agreement with human labels (Cohen's κ), and Cohere is a new provider. (#538)

  • Per-segment quality scores — get_dimension_scores(), get_health_score(), get_scorecard(), and their assertions take by=, which breaks a score down by the values of a column. (#538)

  • Row flags — Validate.get_row_flags() returns the table with a pass/fail column for each row-level step, plus the number of steps each row failed and a weighted row score. Both it and get_sundered_data() take duplicates= ("keep_first", "keep_last" or "flag_all") and duplicates_order_by=, so rows_distinct() steps can take part. (#533)

  • Row-preserving preprocessing — pb.row_preserving() marks a pre= function as one that keeps the table's rows, so its step counts in row flags and sundering. Pointblank checks the function's output during interrogation. (#534)

Enhancements

  • The reports for ablations, data cards, split checks and synthetic-data checks are localized into all 40 reporting languages. Numbers are formatted for the locale, and Arabic, Hebrew and Persian are laid out right-to-left. lang= and locale= are new arguments of Ablation.plan(), Ablation.get_tabular_report(), Validate.to_data_card(), SplitCheck.get_tabular_report() and SyntheticCheck.get_tabular_report(). (#541)
  • columns_subset= in rows_distinct() and rows_complete() now takes a column selector (e.g., pb.starts_with("a")), in Python and in YAML. The selector is resolved during interrogation into a single step over the matched columns. Before, it raised an InvalidIntoExprError. (#559)
  • In action strings and briefs, {col} for a step without a column now reads "all columns" or "the table", in the report's language. {value} now gives the step's main setting, such as the pattern of col_vals_regex(), instead of its internal settings. (#557)

Bug Fixes

  • col_vals_null(), col_vals_not_null(), rows_complete(), and col_pct_null() now count NaN as missing on every backend, not just Pandas. (#553, thanks @DG47)
  • specially() now counts rows with a null result as failing, so n_passed + n_failed equals n. col_vals_in_table() never counts a null or NaN key as found, so it gives the same result on Pandas, Polars and DuckDB. schema_from_tbl() keeps the observed values of categorical columns named like a place or organization (e.g., region, city) instead of assigning a preset. Thanks to @DG47. (#548)
  • assert_passing() now raises an AssertionError (listing the steps that couldn't be evaluated) instead of a TypeError when a step is inactive or couldn't be evaluated. (#545)
  • The row-wise comparison methods (col_vals_gt(), col_vals_between(), and others) now raise a TypeError when a step is defined with pb.ref(), pointing to the aggregate methods or to col(). Before, the error only came at interrogation. (#545)
  • yaml_to_python() now escapes strings, so values with quotes, regex backslashes (e.g., \d, \b), or other special characters produce valid code that checks the same thing. (#558)
  • to_code() and yaml_to_python() write infinite and NaN values as float("inf") and float("nan"). NumPy scalars are written as plain Python values and plain YAML numbers. (#554)
  • yaml_to_python() now writes a col_schema_match() schema as a pb.Schema() call, and a column selector in a YAML python: block is now passed to the step instead of being turned into a string. (#556)
  • conjointly steps now work in Pipeline and in the code from yaml_to_python(). (#555, #558)
  • pb.scorers.classifier() now works with a plain function that takes only the texts. (#555)
  • get_sundered_data(type="fail") no longer fails on PySpark when there are no row-level steps. (#533)
  • Validate.set_tbl() no longer fails on interrogated PySpark validations. (#540)

Behavior Changes

  • rows_complete() steps now count when sundering, so rows with missing values go to the "fail" piece. (#533)
  • On Polars, PyArrow, and DuckDB, a NaN in a float column now counts as missing in the four null checks above, which can change their counts. (#553)
  • specially() steps that return nulls now report those rows as failing. (#548)

Documentation

  • New User Guide pages: Scored Validation, Text Checks, RAG Checks, Data Ablation, Data Cards, Checking Splits, and Checking Synthetic Data. (#534, #536, #537, #538)
  • The agent skills cover the new features, including a new "check-training-data" skill and references for ablation, scorers, and text/RAG checks. (#549)
  • The README and the API reference were updated, including new examples for SplitCheck and SyntheticCheck. (#550, #560)

Maintenance

  • Python 3.13 is now listed in the package classifiers (it was already tested in CI). (#560)