spacy.TextCatBOW.v1 - further documentation #7948
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi! The And if you run
would give you
Where you see that by default, |
Beta Was this translation helpful? Give feedback.
Hi! The
TextCatBow
architecture extracts n-grams from the text. Ifn
is 3, it'll fetch combinations of 3 consecutive tokens. A true "bag of words" model is obtained when you setn
to 1, then it'll extract each word separately. There's a linear layer following those n-grams. The final output layer depends on whether or not the classes of yourtextcat
are exclusive: if they are, the output layer is asoftmax
activation, otherwise it's asigmoid
activation layer (also calledLogistic
in some of our code). You can find the code implementation here: https://github.com/explosion/spaCy/blob/master/spacy/ml/models/textcat.pyAnd if you run
init config
, you can see some default values for this imp…