deprecation issue with add_pipe in spacy
See original GitHub issueI just installed this library to play around and noticed a deprecation between spacy v2 and v3 where the add_pipe function has been altered.
I found the answer here: https://stackoverflow.com/questions/67906945/valueerror-nlp-add-pipe-now-takes-the-string-name-of-the-registered-component-f
Ive changed a file locally (splitter.py lines 8 and 9) from:
import os
import re
import spacy
os.environ['LANGUAGE_MODEL_SPACY'] = "en_core_web_md"
nlp = spacy.load(os.environ['LANGUAGE_MODEL_SPACY'])
sentencizer = nlp.create_pipe("sentencizer")
nlp.add_pipe(sentencizer)
to:
import os
import re
import spacy
os.environ['LANGUAGE_MODEL_SPACY'] = "en_core_web_md"
nlp = spacy.load(os.environ['LANGUAGE_MODEL_SPACY'])
#sentencizer = nlp.create_pipe("sentencizer") #<-- not needed
nlp.add_pipe("sentencizer") #<-- made into a string.
This worked for me since I have v3 of spacy but im not sure how to make this work regardless of any other users in the future with different versions of spacy. Ill leave the decision to you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
What's New in v3.0 · spaCy Usage Documentation
Note that spaCy v3.0 now requires Python 3.6+. API changes. Pipeline package symlinks, the link command and shortcut names are now deprecated ......
Read more >Unexpected behavior of nlp.has_pipe("sentencizer") #2693
I was able to recreate the issue on my computer. It looks like pipe_create is the only pipe method for which the alias...
Read more >spaCy add_pipe() and analyze_pipes() error - python
It works on its website but not in my jupyternotebook. When I ran the following code: import spacy. nlp = spacy.blank("en") nlp.add_pipe("tagger ...
Read more >Spacy linking deprecation error - Rasa Open Source
When I using the command “python -m spacy link en_core_web_md en”. I receive a deprecation error. So, I can't link spacy Rasa Version:...
Read more >Changelog
Fix issue where the FlowRunView could fail to initialize when the ... Remove deprecated prefect agent local start flag --storage-labels ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For sure @jonathan-rowley, thanks for getting back. Please, keep testing it and feel free to reach out if you have any comments/suggestions on how to improve it.
@almarengo, Thanks for the offer. I am currently evaluating to see if sent2vec can solve some of my problems and I like it so far but still have some more to test. If I come across any issues that I can find then i will try and open an issue here with any possible resolutions i can come up with. for this time I guess that puts me in a testing role and if I find a good way to integrate with sent2vec I wouldnt mind adding to or improving down the road.