class_docstr: A trainer for training models. 
class_docstr_tok: ["A","trainer","for","training","models","."]
code: def build_seq2seq(self, args, emb_matrix, foundation_cache):
      charmodel = None
      charlms = []
      if args is not None and args.get("charlm_forward_file", None):
          charmodel_forward = load_charlm(
              args["charlm_forward_file"],
              foundation_cache=foundation_cache,
          )
          charlms.append(charmodel_forward)
      if args is not None and args.get("charlm_backward_file", None):
          charmodel_backward = load_charlm(
              args["charlm_backward_file"],
              foundation_cache=foundation_cache,
          )
          charlms.append(charmodel_backward)
      if len(charlms) > 0:
          charlms = nn.ModuleList(charlms)
          charmodel = CharacterLanguageModelWordAdapter(charlms)
      model = Seq2SeqModel(
          args, emb_matrix=emb_matrix, contextual_embedding=charmodel
      )
      return model
  
imports: import os
  import sys
  import numpy
  from collections import Counter
  import logging
  import torch
  from torch import nn
  import torch.nn.init
  import stanza.models.common.seq2seq_constant
  from stanza.models.common.foundation_cache import load_charlm
  from stanza.models.common.seq2seq_model import Seq2SeqModel
  from stanza.models.common.char_model import CharacterLanguageModelWordAdapter
  from stanza.models.common import utils, loss
  from stanza.models.lemma import edit
  from stanza.models.lemma.vocab import MultiVocab
label_desc: Use image node_id 2 for calling the Trainer obj's underlying member method code with example usage: obj.build_seq2seq(args, emb_matrix, foundation_cache) and returns: model