def get_processing_speech(vocab_speech = None):
    """
    Function: 
        Return function that maps the speech key to a set of interval and word ids
    Args:
        vocab: dict[key] = idx
    Returns:
        f("2005-A-10-1-5") = ([12, 4, 32], 12345)
                 = (list of interval ids, word id)
    """
    def f(key):
        num_interval = int(key.split("-")[-1])
        word_key = "-".join(key.split("-")[:-1])

        # 0. get interval of words
        intervals = []
        for interval in range(num_interval):
            intervals.append(word_key + "-" + str(interval))

        # 1. get interval_ids (if possible)
        if vocab_speech is not None:
            interval_ids = []
            for interval in intervals:
                interval_ids.append(vocab_speech[interval])
            return interval_ids
        else:
            return intervals

    return f