Skip to content

add_pipe not working with "en_core_web_sm" #11433

@arditobryan

Description

@arditobryan

Hi, I have tried to use my own lemmatizer on en_core_web_sm:

nlp = spacy.load('en_core_web_sm', disable=['lemmatizer']) 
nlp.remove_pipe("lemmatizer") #DISABLE seems not to be working, this is a good replacement

print(1, nlp.pipe_names)

#add pipeline component
config = {"mode": "lookup"}
lemmatizer = nlp.add_pipe("lemmatizer", config=config)
lemmatizer.initialize()

print(2, nlp.pipe_names)

sentence = "What a wonderful day today for playing"
doc = nlp(sentence)```

If I look at the nlp.pipe_names output:

1 ['tok2vec', 'tagger', 'parser', 'attribute_ruler', 'ner']
2 ['tok2vec', 'tagger', 'parser', 'attribute_ruler', 'ner']

The lemmatizer has not been added: I tried with nlp = English() and works.
Another issue, I had to use nlp.remove_pipe("lemmatizer") because disable was not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions