Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add a supported artifact-directory persistence API for Anonymizer results

Open
#285 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start with the public AnonymizerResult interface and the existing private anonymizer.engine encoding helper mentioned in the issue. Trace how replace and rewrite results hold their user-facing and trace datasets, metadata, and failed records. Done means a versioned directory can be written and loaded with empty, populated, and mixed skipped_span_label_counts values round-tripping without downstream imports or DataFrame mutation.

Written by the indexing model from the issue text.

Description

enhancement
Priority Level

Medium (Nice to have)

Is your feature request related to a problem?

NeMo Platform currently persists AnonymizerResult.dataframe and trace_dataframe itself. This requires Platform to understand Anonymizer's internal DataFrame schemas and reproduce library-specific serialization behavior.

In NVIDIA-NeMo/nemo-platform#2237, Platform had to duplicate Anonymizer's JSON encoding of ReplacementApplication.skipped_span_label_counts before writing the trace to Parquet, then import a private anonymizer.engine helper to decode it when reading. Without this encoding, an all-empty nested mapping is inferred by Arrow as an empty struct and cannot be written to Parquet.

This creates a fragile cross-repository contract: changes to Anonymizer's trace schema or encoding may silently break downstream integrations.

Describe the solution you'd like

Provide a supported, public API that writes all artifacts associated with an AnonymizerResult to a directory, with Anonymizer owning the on-disk representation and all required encoding.

For example:

result.write_artifacts(output_directory)

Ideally, provide a corresponding loader:

result = AnonymizerResult.read_artifacts(output_directory)

The artifact directory should include, as applicable:

  • The user-facing result dataset
  • The full trace dataset
  • Result metadata, including resolved_text_column
  • Failed records
  • An artifact-format version

The implementation should:

  • Handle Parquet-incompatible internal values without downstream preprocessing
  • Restore documented in-memory types when artifacts are loaded
  • Avoid mutating the original result DataFrames
  • Work for both replace and rewrite results
  • Expose the functionality through the public interface rather than anonymizer.engine

Downstream systems such as NeMo Platform should only need to ask Anonymizer to write the directory and then upload it wholesale.

Acceptance criteria
  • A public API writes a complete result artifact directory.
  • A supported API can load that directory and reconstruct the result.
  • Empty, populated, and mixed skipped_span_label_counts values round-trip correctly.
  • Tests cover both replace and rewrite results.
  • Consumers do not need to import from anonymizer.engine.
  • The artifact format is versioned for future schema evolution.
  • Public documentation and the bundled Anonymizer skill are updated if needed.
Describe alternatives you've considered
  • Keep the encoding logic in NeMo Platform. This duplicates library internals and must remain synchronized with Anonymizer.
  • Expose only the existing encoding helper publicly. This fixes the immediate field but still requires every integration to understand and persist Anonymizer's complete result schema.
  • Remove the problematic trace column before persistence. This loses useful diagnostics.
Additional context

Triggered by the Anonymizer 0.4.0 Platform upgrade: NVIDIA-NeMo/nemo-platform#2237, specifically commit 81c046b.

Dominant language
Python
Stars
129
Forks
21
Avg merge
2d 6h
Merged PRs (30d)
21

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA-NeMo/Anonymizer

All issues in NVIDIA-NeMo/Anonymizer

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.