def get_numbers_from_utterance(utterance: str, tokenized_utterance: List[Token]) -> Dict[str, List[int]]:
    """
    Given an utterance, this function finds all the numbers that are in the action space. Since we need to
    keep track of linking scores, we represent the numbers as a dictionary, where the keys are the string
    representation of the number and the values are lists of the token indices that triggers that number.
    """
    # When we use a regex to find numbers or strings, we need a mapping from
    # the character to which token triggered it.
    char_offset_to_token_index = {token.idx : token_index
                                  for token_index, token in enumerate(tokenized_utterance)}

    # We want to look up later for each time whether it appears after a word
    # such as "about" or "approximately".
    indices_of_approximate_words = {index for index, token in enumerate(tokenized_utterance)
                                    if token.text in APPROX_WORDS}

    indices_of_words_preceding_time = {index for index, token in enumerate(tokenized_utterance)
                                       if token.text in WORDS_PRECEDING_TIME}

    indices_of_am_pm = {index for index, token in enumerate(tokenized_utterance)
                        if token.text in {'am', 'pm'}}

    number_linking_dict: Dict[str, List[int]] = defaultdict(list)

    for token_index, token in enumerate(tokenized_utterance):
        if token.text.isdigit():
            if token_index - 1 in indices_of_words_preceding_time and token_index + 1 not in indices_of_am_pm:
                for time in digit_to_query_time(token.text):
                    number_linking_dict[str(time)].append(token_index)
    times_linking_dict = get_times_from_utterance(utterance,
                                                  char_offset_to_token_index,
                                                  indices_of_approximate_words)
    for key, value in times_linking_dict.items():
        number_linking_dict[key].extend(value)

    for index, token in enumerate(tokenized_utterance):
        for number in NUMBER_TRIGGER_DICT.get(token.text, []):
            if index - 1 in indices_of_approximate_words:
                for approx_time in get_approximate_times([int(number)]):
                    number_linking_dict[str(approx_time)].append(index)
            else:
                number_linking_dict[number].append(index)
    return number_linking_dict
Given an utterance, this function finds all the numbers that are in the action space. Since we need to
    keep track of linking scores, we represent the numbers as a dictionary, where the keys are the string
    representation of the number and the values are lists of the token indices that triggers that number.