<p>The <code>maxlen</code> parameter is the length of your text samples in words. </p>

<p>In the Keras code example you have these settings: </p>

<pre><code># set parameters:
max_features = 5000
maxlen = 400
...
embedding_dims = 50
</code></pre>

<p>This means you have a vocabulary of 5000 words, each of these words are embedded into a feature vector with 50 dimensions and each of your text samples can be 400 words long. </p>

<p>Indirectly this also has a relation to padding when you have text samples that are shorter than 400 words. Then you have to pad these to a length of 400. </p>

<p>For 1D-ConvNets for text classification see also this paper and this blog post:</p>

<p><a href="https://arxiv.org/abs/1408.5882" rel="nofollow noreferrer">https://arxiv.org/abs/1408.5882</a> </p>

<p><a href="http://www.wildml.com/2015/11/understanding-convolutional-neural-networks-for-nlp/" rel="nofollow noreferrer">http://www.wildml.com/2015/11/understanding-convolutional-neural-networks-for-nlp/</a></p>
Keras Parameters for Convolutional Net
<p>I'm looking at Keras' example for convolutional neural networks. (See <a href="https://github.com/fchollet/keras/blob/master/examples/imdb_cnn.py" rel="nofollow noreferrer">https://github.com/fchollet/keras/blob/master/examples/imdb_cnn.py</a> for example.) However, I cannot figure out what they mean by the "maxlen" parameter. Would it have something to do with padding? It isn't the maximum number of features; they have a max_features parameter for that. </p>