Error in Exercise

Error in Exercise

by Edison Alain von Matt -
Number of replies: 3

Hey all!

I get the following error when I try to run the first block in section 4) SpaCy Classifier, which we should leave unmodified. Already tried to set up different environments and installed different versions of spacy. Nothing works so far - does anyone have an idea?

Or should we replace the "text_categorizer" for another factory mentioned below?

Error:

ValueError: [E002] Can't find factory for 'text_categorizer' for language English (en). This usually happens when spaCy calls `nlp.create_pipe` with a custom component name that's not registered on the current language class. If you're using a Transformer, make sure to install 'spacy-transformers'. If you're using a custom component, make sure you've added the decorator `@Language.component` (for function components) or `@Language.factory` (for class components). 

Available factories: attribute_ruler, tok2vec, merge_noun_chunks, merge_entities, merge_subtokens, token_splitter, doc_cleaner, parser, beam_parser, lemmatizer, trainable_lemmatizer, entity_linker, entity_ruler, tagger, morphologizer, ner, beam_ner, senter, sentencizer, spancat, spancat_singlelabel, span_finder, future_entity_ruler, span_ruler, textcat, textcat_multilabel, classy_classification, transformer, en.lemmatizer


Thanks for your help!

In reply to Edison Alain von Matt

Re: Error in Exercise

by Vittorio Rossi -
Hi Edison,
I had the same problem and did not bother digging too deep into it, but this is what I think is happening.
I'm guessing the "text_categorizer" factory is from a previous package version and has been replaced by "textcat."
If you swap them some new errors will start popping up related to other parameters of the method, so at that point, I stopped trying to debug and moved on, but feel free to go down the rabbit hole or hear out how others have fixed it.
I know this ain't much, but I hope it's better than nothing.
In reply to Edison Alain von Matt

Re: Error in Exercise

by Deniz Bayazit -
Hi! This is due to some package versions that got updated. I will update the practical session with the exact Python and package versions. Sorry about that. In order to focus on the concepts rather than package versioning, I suggest taking a look at the prerun version of the notebook at: https://coling.epfl.ch/TP/TP-SpamClassification-prerun.ipynb
All the best,
Deniz