This function takes a dataset and converts
    it into sequences via multiprocessing

def convert_to_sequences(dataset, vocab):
    """This function takes a dataset and converts
    it into sequences via multiprocessing
    """
    start = time.time()
    dataset_vocab = map(lambda x: (x, vocab), dataset)
    with mp.Pool() as pool:
        # Each sample is processed in an asynchronous manner.
        output = pool.map(get_sequence, dataset_vocab)
    end = time.time()
    logging.info('Done! Sequence conversion Time={:.2f}s, #Sentences={}'
                 .format(end - start, len(dataset)))
    return output