code: def get_strings_from_utterance(tokenized_utterance):
      """
      Based on the current utterance, return a dictionary where the keys are the strings in the utterance
      that map to lists of the token indices that they are linked to.
      """
      string_linking_scores = defaultdict(list)
      for index, (first_token, second_token) in enumerate(
          izip(tokenized_utterance, tokenized_utterance[1:])
      ):
          for string in ATIS_TRIGGER_DICT.get(
              first_token.text.lower(), []
          ):
              string_linking_scores[string].append(index)
  
          bigram = "{first_token.text} {second_token.text}".lower()
          for string in ATIS_TRIGGER_DICT.get(bigram, []):
              string_linking_scores[string].extend([index, index + 1])
  
      if tokenized_utterance[-1].text.lower() in ATIS_TRIGGER_DICT:
          for string in ATIS_TRIGGER_DICT[
              tokenized_utterance[-1].text.lower()
          ]:
              string_linking_scores[string].append(
                  len(tokenized_utterance) - 1
              )
  
      date = get_date_from_utterance(tokenized_utterance)
      if date:
          for day in DAY_OF_WEEK_INDEX[date.weekday()]:
              string_linking_scores[day] = []
  
      return string_linking_scores
  
file_path: magnitude/pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py
imports: from __future__ import absolute_import
  from copy import deepcopy
  import numpy
  from parsimonious.grammar import Grammar
  from allennlp.semparse.contexts.atis_tables import *
  from allennlp.semparse.contexts.sql_table_context import SqlTableContext, SqlVisitor, generate_one_of_string, format_action
  from allennlp.data.tokenizers import Token, WordTokenizer
label_desc: Use image node_id 1 for calling a global function with example usage: get_strings_from_utterance(tokenized_utterance) and returns: string_linking_scores