Skip to content
Discussion options

You must be logged in to vote

We currently don't have any callbacks on pipe completion, but I can think of two ways to go about. First, you could make a loop calling the pipes similar to how Language does:

for name, proc in self.pipeline:
    doc = proc(doc)
    # Add code here to inspect doc

You shouldn't use this in production code, since Language does many additional things, but it can be ok for debugging. The other option is to make a custom pipe component. This component could just return the doc as-is, but you could insert your instrumentation code into it. You could then use this component after the pipe(s) that you want to instrument.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kamlesh0606
Comment options

@danieldk
Comment options

Answer selected by danieldk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General spaCy usage feat / pipeline Feature: Processing pipeline and components
2 participants