Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wasiflatifhussain opened this issue Feb 18, 2023 · 0 comments

Comments

@wasiflatifhussain
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant