Skip to content

nlp.add_pipe now takes the string name of the registered component factory #3

@wasiflatifhussain

Description

@wasiflatifhussain

I get this error when I try to run the model for the test-run given in the README.md.
I simply copy pasted the code given in the snippet in README.md

-I am using latest version of python and pip3
Could the error be resulting due to that?

Loading nlp tools...
Traceback (most recent call last):
File "/Users/wasiflatifhussain/Documents/Resume-Rater/main.py", line 96, in
r = RatingModel(_type, model_path)
File "/Users/wasiflatifhussain/Documents/Resume-Rater/src/model.py", line 62, in init
self.nlp = loadDefaultNLP()
File "/Users/wasiflatifhussain/Documents/Resume-Rater/src/utils.py", line 29, in loadDefaultNLP
nlp.add_pipe(passer, before="parser")
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/spacy/language.py", line 772, in add_pipe
raise ValueError(err)
ValueError: [E966] nlp.add_pipe now takes the string name of the registered component factory, not a callable component. Expected string, but got <function loadDefaultNLP..segment_on_newline at 0x1398aa5f0> (name: 'None').

  • If you created your component with nlp.create_pipe('name'): remove nlp.create_pipe and call nlp.add_pipe('name') instead.

  • If you passed in a component like TextCategorizer(): call nlp.add_pipe with the string name instead, e.g. nlp.add_pipe('textcat').

  • If you're using a custom component: Add the decorator @Language.component (for function components) or @Language.factory (for class components / factories) to your custom component and assign it a name, e.g. @Language.component('your_name'). You can then run nlp.add_pipe('your_name') to add it to the pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions