def convert_text_to_tokens(data, base_vocab, tokenize_fn, custom_vocab={}):
    """
        Converts sequences of text to sequences of token ids per the provided vocabulary

        Arguments:
            data                   (arr) : sequences of text
            base_vocab (torchtext.vocab) : vocabulary object
            tokenize_fun      (function) : function to use to break up text into tokens

        Returns:
            arr : array of arrays, each inner array is a token_id representation of the text passed in

    """
    word_seqs = [tokenize_fn(seq) for seq in data]
    token_seqs = [[custom_vocab[word] if word in custom_vocab else base_vocab[word] for word in word_seq] for word_seq in word_seqs]

    return token_seqs