code: def vocabs_to_dict(vocabs):
      """
      Convert a dict of pyonmttok vocabs
      into a plain text dict to be saved in the checkpoint
      """
      vocabs_dict = {}
      vocabs_dict["src"] = vocabs["src"].ids_to_tokens
      vocabs_dict["tgt"] = vocabs["tgt"].ids_to_tokens
      if "src_feats" in vocabs.keys():
          vocabs_dict["src_feats"] = [
              feat_vocab.ids_to_tokens
              for feat_vocab in vocabs["src_feats"]
          ]
      vocabs_dict["data_task"] = vocabs["data_task"]
      if "decoder_start_token" in vocabs.keys():
          vocabs_dict["decoder_start_token"] = vocabs[
              "decoder_start_token"
          ]
      else:
          vocabs_dict["decoder_start_token"] = DefaultTokens.BOS
      return vocabs_dict
  
file_path: OpenNMT-py/onmt/inputters/inputter.py
imports: import os
  from math import ceil
  import codecs
  import pyonmttok
  from onmt.constants import DefaultTokens
label_desc: Use image node_id 3 for calling a global function with example usage: vocabs_to_dict(vocabs) and returns: vocabs_dict