Where can one configure the CNN used by the Spacy TextCategorizer?

537 Views Asked by At

According to the comment at the top of the TextCategorizer,

Train a convolutional neural network text classifier on the IMDB dataset, using the TextCategorizer component. The dataset will be loaded automatically via Thinc's built-in dataset loader. The model is added to spacy.pipeline, and predictions are available via doc.cats. For more details, see the documentation: * Training: https://spacy.io/usage/training

Where is the code for the CNN? Can the CNN be configured? Is there a research paper the implementation is based on?

1

There are 1 best solutions below

0
On

The network architecture is defined in the _.ml module specifically within the build_text_classifier function.

The code related with the training is within the pipeline module specifically within the TextCategorizer class.

Some parameters like drop_out, batch_size and the number of epochs can be configured as showed in the example, you can also modify the architecture of the network but for that you have to know about the framework behind spaCy which is called Thinc https://github.com/explosion/thinc and some Cython.

I don't know about any paper describing the model but this video provide a great description of it https://www.youtube.com/watch?v=sqDHBH9IjRU