Skip to content
Discussion options

You must be logged in to vote

Hello,

You can use nlp.get_pipe (docs) do get individual components from a spaCy pipeline and use them to process Doc objects.

nlp = spacy.load("your_model")

# doc_bytes = The way you're loading in your bytes_file
doc = Doc(nlp.vocab).from_bytes(doc_bytes)

your_component = nlp.get_pipe("your_component")
result = your_component(doc)

You can also disable or exclude components from a pipeline when using spacy.load() (docs).

spacy.load("your_model", disable=["component_to_disable"]) # Components that will be loaded but do not process any Docs
spacy.load("your_model", exclude=["component_to_exclude"]) # Components that won't be loaded into the model
spacy.load("your_model", enable=["your_co…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by thomashacker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / pipeline Feature: Processing pipeline and components
2 participants