0Pricing
NLP Academy · Lesson

Customizing the Pipeline

Add, disable, and reorder components.

Customizing the Pipeline is a free NLP Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the NLP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

A Stack of Steps

A spaCy pipeline is just an ordered list of components. Text flows through each one, gaining tags, parses, and entities along the way.

See What Is Loaded

Check the active steps with nlp.pipe_names. It lists every component in order, so you always know what is running.

print(nlp.pipe_names)

Disable for Speed

Skip work you do not need with disable. Turning off the parser when you only want entities makes processing noticeably faster.

nlp = spacy.load("en_core_web_sm", disable=["parser"])

Disable Temporarily

For a quick run, use select_pipes as a context manager. It switches components off, then restores them when the block ends.

with nlp.select_pipes(disable=["ner"]):
    doc = nlp(text)

Add Your Own Step

You extend the pipeline with add_pipe. spaCy ships ready-made components like sentencizer that you can drop right in.

nlp.add_pipe("sentencizer")

Control the Order

Position matters. With first or before, you place a component exactly where it needs to run in the sequence.

nlp.add_pipe("sentencizer", first=True)

Write a Custom Component

You can register your own logic as a component. A simple function takes a Doc, tweaks it, and returns it for the next step.

@spacy.Language.component("my_step")
def my_step(doc):
    return doc

Plug It In

Once registered, add your component by name. From then on it runs automatically every time you call nlp().

nlp.add_pipe("my_step", last=True)

Remove a Step

Changed your mind? remove_pipe takes a component out cleanly, leaving the rest of the pipeline untouched.

nlp.remove_pipe("my_step")

Reorder Components

You can shuffle steps later too. Combining remove and add lets you reorder the pipeline until the flow is exactly right.

Why It All Matters

Customizing the pipeline keeps spaCy lean and tailored. You run only what your task needs, plus any logic unique to your domain.

Quick Check

How do you add a component to a spaCy pipeline?

Recap

You inspect steps with pipe_names, drop work with disable, and shape the flow using add_pipe and remove_pipe. The pipeline bends to fit your task. 🛠️

Frequently asked questions

Is the “Customizing the Pipeline” lesson free?

Yes — the full text of “Customizing the Pipeline” is free to read here on the web, and the NLP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the NLP Academy course, upgrade to CoddyKit PRO.

What will I learn in “Customizing the Pipeline”?

Add, disable, and reorder components. You practise NLP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start NLP Academy?

No prior experience is required. NLP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Customizing the Pipeline” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this NLP Academy lesson?

Yes. Every NLP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why spaCy for Real Projects
  2. Loading a Model and Processing a Doc
  3. Tokens, Spans, and Doc Objects
  4. Customizing the Pipeline
← Back to NLP Academy