Skip to content
Discussion options

You must be logged in to vote

Hey Zanejins,

If you load a pre-trained model:

import spacy
nlp = spacy.load("en_core_web_sm")

then you can iterate through the individual pipeline components. For example to print out the names of each pipe you can do

for name, proc in nlp.pipeline:
    print(name)

which gives the output:

tok2vec
tagger
parser
attribute_ruler
lemmatizer
ner

If you print the "proc" that stands for "processor" you get:

for name, proc in nlp.pipeline:
    print(proc)
<spacy.pipeline.tok2vec.Tok2Vec object at 0x7f4f3e303c20>
<spacy.pipeline.tagger.Tagger object at 0x7f4f3e303a60>
<spacy.pipeline.dep_parser.DependencyParser object at 0x7f4f3e11f0d0>
<spacy.pipeline.attributeruler.AttributeRuler object at 0x7f…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by adrianeboyd
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