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

Adding custom items to nlp pipeline does not insert them in the correct order #1654

Closed
demongolem opened this issue Nov 27, 2017 · 2 comments
Labels
bug Bugs and behaviour differing from documentation

Comments

@demongolem
Copy link
Contributor

Using v 2.0 of spaCy with Python 2.7 on Ubuntu 14.03. I attempt to add 2 customer annotators to the pipeline using after. They do not end up in the position I would expect after the complete pipeline has been constructed.

I do as such:

nlp = spacy.load('en')

# Hook in your own deep learning models
print nlp.pipeline
nlp.add_pipe(first_regex, name='regex1', after='ner')
print nlp.pipeline
nlp.add_pipe(custom_model_trivial, name='useless', after='regex1')
print nlp.pipeline

The order goes from

tagger, parser, ner

to

tagger, parser, regex1, ner

to

tagger, parser, useless, regex1, ner

I would expect the order to be

tagger, parser, ner, regex1, useless

@honnibal honnibal added the bug Bugs and behaviour differing from documentation label Nov 27, 2017
@honnibal
Copy link
Member

Thanks, I thought we tested this! I think the problem is almost surely when we do after and the referenced item is at the end. I think we probably need to trigger an append here instead of an insert.

@lock
Copy link

lock bot commented May 8, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

2 participants