def get_tag_id(tag):
  """Given the tag string, returns its index in the vocabulary."""
  index = LANG_TAGS.index(tag)
  # Adjust index to account for the tokens reserved by text_encoder.
  index += len(text_encoder.RESERVED_TOKENS)
  return index
Given the tag string, returns its index in the vocabulary.
language/labs/consistent_zero_shot_nmt/data_generators/translate_multilingual.py