Add a supported artifact-directory persistence API for Anonymizer results
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
- Domain
- backend-api-design, data
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
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_countsvalues 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA-NeMo/Anonymizer
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NVIDIA-NeMo/Anonymizer#327 ·
Maintainers usually reply within 1 day
-
Replacement-map generation can silently omit a requested entity, causing the rewrite to be marked unavailablePossibly taken @dundysm claimed this 32 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Anonymizer#278 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA-NeMo/Anonymizer#6 · 1 comment ·
Maintainers usually reply within 1 day
-
task
Difficulty 4/5 3-5 days Newbie friendliness 48/100
NVIDIA-NeMo/Anonymizer#323 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
NVIDIA-NeMo/Anonymizer#304 ·
Maintainers usually reply within 1 day
All issues in NVIDIA-NeMo/Anonymizer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
google-agentic-commerce/AP2#388 ·
-
area:codegen backend:cuda backend:hip bug direction:input
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CrossGL/crosstl#3061 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
rlaope/oh-my-hermes#2304 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
mochan-tk/agentic-dev-kit-for-codex#64 ·
Maintainers usually reply within 1 day
-
bug docs performance
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 3 days