def id2seq(data, i2w):
    """
    `data` is a list of sequences. Each sequence is a list of numbers. For
    example, the following could be an example of data:

    [[1, 10, 4, 1, 6],
     [1, 2,  5, 1, 3],
     [1, 8,  4, 1, 2]]

    Each number represents the ID of a word in the vocabulary `i2w`. This
    function transforms each list of numbers into the corresponding list of
    words. For example, the list above could be transformed into:

    [['the', 'dog',  'chased', 'the', 'cat' ],
     ['the', 'boy',  'kicked', 'the', 'girl'],
     ['the', 'girl', 'chased', 'the', 'boy' ]]

    For a function that transforms the abovementioned list of words back into
    IDs, see `seq2id`.
    """
    buff = []
    for seq in data:
        w_seq = []
        for term in seq:
            if term in i2w:
                if term == 0 or term == 1 or term == 2:
                    continue
                w_seq.append(i2w[term])
        sent = ' '.join(w_seq)
        buff.append(sent)
    return buff