def get_reverse_vocab(vocab):
    """
    Given a vocab list (e.g., {'word': index}), reverse it and return
    (e.g., { index: 'word'})
    """
    reverse_vocab = {0:'<pad>', 1:'<unk>', 2:'<num>', 3:'<newline>'}
    for word, index in vocab.items():
        reverse_vocab[index] = word
    return reverse_vocab