Approaches
We'll implement all the three methods: a basic RNN, an advanced RNN like LSTM or GRU, and a recursive network like SPINN, before looping through the SNLI dataset. Each data instance gives us a pair of sentences, a premise, and a hypothesis sentence. The sentences are converted to embeddings first and then passed into each implementation. While the process is the same for simple RNNs and advanced RNNs, SPINNs introduce a completely different flow for training and inference. Let's start with a simple RNN.
Simple RNN
RNNs have been used as the go-to NLP technique for understanding the meaning of data, and we can complete a numerous variety of tasks based on the sequential relations found from it. We will use this simple RNN to show how recurrence works effectively to accumulate the meaning and understand the meaning of words based on the context the words are in.
Before we start building any core modules of our network, we'll have to process the dataset and...