One-dimensional CNNs (Conv1D)
Another architecture to take into account when working with texts is one-dimensional CNNs (Conv1D). The principle on which they are based is similar to the 2D CNN that we saw in the previous chapter, Chapter 4, Image Classification and Regression Using AutoKeras. These neural networks manage to learn patterns in text through filters, in the same way as they did with images in the previous chapter.
An example of a one-dimensional CNN is shown in the following diagram:
It is good to know that if the chronological order of the elements in the sequence is important for the prediction, the RNNs are much more effective, thus one-dimensional CNNs are often combined with the RNNs to create high-performance models. The exhaustive search performed by AutoKeras takes both into account to find the best model.
Now, let's put the learned concepts into practice with some practical...