Skip to content

Mimic spaCy pipeline API #83

@sam-writer

Description

@sam-writer

replaCy extensions can be added... but not removed or renamed. We also don't constrain component names to be unique. So to match the spaCy API (and just have reasonable functionality), we need:

  • remove_pipe method
  • rename_pipe method
  • replace_pipe method
  • when instantiating ReplaceMatcher, allow disable=["any built in component"] passed as kwarg to disable those components for that instance
  • when calling ReplaceMatcher.__call__, allow disable=["any built in component"] passed as kwarg to disable those components for that invocation
  • (maybe) disable_pipes context manager

see the spaCy docs.

the context manager would look like:

replaCy = ReplaceMatcher(stuff)

with replaCy.disable_pipes("scorer"):
    spans = replaCy("some text")

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions