Skip to content

Add Philter, pyDeid, and GLiNER-BioMed comparator adapters #163

@maziyarpanahi

Description

@maziyarpanahi

Summary

The roadmap names four interop adapters (section 2.2a, section 4.6): presidio, philter, pydeid, gliner_biomed. With the package and contract established (OM-035), the remaining three must land so OpenMed can register Philter (BSD-3) and pyDeid (MIT) as in-process comparators feeding arbitration, and GLiNER-BioMed (Apache-2.0) as a zero-shot label contributor. These let OpenMed publish head-to-head comparisons while keeping every wrapped tool optional and downstream OpenMed is the orchestrator, never the dependent. This task EXTENDS (does not rewrite) the OM-035 registry contract in interop/init.py, appending adapters.

Scope

  • openmed/interop/philter.py: to_canonical/from_canonical for Philter output (BSD-3); in-process comparator routed through pii_entity_merger arbitration.
  • openmed/interop/pydeid.py: to_canonical/from_canonical for pyDeid output (MIT); comparator role.
  • openmed/interop/gliner_biomed.py: to_canonical for GLiNER-BioMed zero-shot output mapped onto canonical labels (reuse the existing [gliner] extra).
  • Add [philter] and [pydeid] extras to pyproject.toml; each adapter import-guarded so the core install never pulls them.
  • Unit tests per adapter: round-trip >= N golden spans with zero label loss; core-no-import guard extended to cover all four adapters.

Acceptance criteria

  • openmed/interop/{philter,pydeid,gliner_biomed}.py each expose to_canonical (and from_canonical where reversible) producing list[PIIEntity] with canonical labels and preserved offsets.
  • pyproject.toml declares [philter] and [pydeid] extras; gliner_biomed reuses the existing [gliner] extra.
  • The core-no-import test asserts 'import openmed' imports none of philter/pydeid/gliner adapter dependencies.
  • Each adapter's spans pass through pii_entity_merger arbitration in a test, contributing to (not overriding) first-party detection.
  • test suite green: .venv/bin/python -m pytest tests/ -q

Out of scope

  • Out-of-process GPL bridges (PhysioNet deid Perl, sdcMicro, CliniDeID, MedCAT) gated behind [interop-gpl] (section 4.6 I2).
  • Registering GLiNER-BioMed as a production zero-shot backbone (separate ner/zero_shot task).
  • Publishing the comparator benchmark numbers (OM-018/OM-020).

Files

  • openmed/interop/philter.py
  • openmed/interop/pydeid.py
  • openmed/interop/gliner_biomed.py
  • pyproject.toml
  • tests/unit/interop/test_philter_adapter.py
  • tests/unit/interop/test_pydeid_adapter.py
  • tests/unit/interop/test_gliner_biomed_adapter.py

Task: OM-048 · Milestone: v1.7 · Priority: P2 · Size: M
Depends on: OM-035 · Blocks: —
Roadmap: section 2.2a, section 2.1 (Philter/pyDeid/GLiNER rows), section 4.6
Spec: PLANS/V2/EXECUTION/tasks/OM-048.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2MediumfeatureNew capabilityroadmap-v2OpenMed V2 roadmap backlog

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions