Convolutional neural networks (CNN) [1]} are a special kind of neural networks that work on grid-like topology such as image data (2D grid of pixels) and text data (1D grid of word vectors). CNN is used to extract important features from data automatically. Here, I will describe the CNN in the context of text data. The tokens in the text can be represented as a sequence of vectors \(\lbrace \mathbf {x}_1, \mathbf {x}_2,....., \mathbf {x}_n\rbrace \)  where \(\mathbf {x} \in \mathbb {R}^{d}\)  and \(n\)  is the sequence length. Eq. (2.6) defines the convolution function for text data. \(\Vert \)  is the concatenation operation.
\(&c_i = \mathbf {f}^T (\mathbf {x}_{i} \Vert \mathbf {x}_{i + 1} \Vert .... \Vert \mathbf {x}_{i+k-1})\\& c_{max} = \text{max}(c_1,c_2,....,c_{n})\\& \mathbf {v}_{max} = [c_{max}^1, c_{max}^2, ...., c_{max}^{f_k}]\\& c_{avg} = \frac{c_1 + c_2 + .... + c_{n}}{n}\\& \mathbf {v}_{avg} = [c_{avg}^1, c_{avg}^2, ...., c_{avg}^{f_k}]\) 
