code: def load_index(
      input_name: str,
  ) -> Tuple[List[str], Dict[str, List[Tuple[int, int, int, float]]]]:
      """Load index from file
      Args:
          input_name: file with index
      Returns:
          phrases: List of all phrases in custom vocabulary. Position corresponds to phrase_id.
          ngram2phrases: dict where key=ngram, value=list of tuples (phrase_id, begin_pos, size, logprob)
      """
      phrases = []  # id to phrase
      phrase2id = {}  # phrase to id
      ngram2phrases = defaultdict(
          list
      )  # ngram to list of tuples (phrase_id, begin_pos, size, logprob)
      with open(input_name, "r", encoding="utf-8") as f:
          for line in f:
              ngram, phrase, b, size, lp = line.split("\t")
              b = int(b)
              size = int(size)
              lp = float(lp)
              if phrase not in phrase2id:
                  phrases.append(phrase)
                  phrase2id[phrase] = len(phrases) - 1
              ngram2phrases[ngram].append(
                  (phrase2id[phrase], b, size, lp)
              )
      return phrases, ngram2phrases
  
imports: import json
  import math
  import random
  import re
  from collections import defaultdict, namedtuple
  from typing import Dict, List, Set, Tuple, Union
  import numpy
  from numba import jit
label_desc: Use image node_id 6 for calling a global function with example usage: load_index(input_name) and returns: phrases,  ngram2phrases