(vocab_file_path, config, output_index=None)
Prepare vocab from config.
Prepare vocab from config.
Prepare vocab from config .
def prepare_vocab_from_config(vocab_file_path, config, output_index=None):
  """Prepare vocab from config."""
  if output_index is None:
    label_config = config["data"]["task"]["classes"]["vocab"]
  else:
    label_config = config["data"]["task"]["classes"][output_index]["vocab"]

  save_vocabs(label_config, vocab_file_path)
def prepare_vocab_from_config ( vocab_file_path , config , output_index = None ) : if output_index is None : label_config = config [ "data" ] [ "task" ] [ "classes" ] [ "vocab" ] else : label_config = config [ "data" ] [ "task" ] [ "classes" ] [ output_index ] [ "vocab" ] save_vocabs ( label_config , vocab_file_path )