code: def from_new_model(cls, args, vocab):
      model = CharacterLanguageModel(
          args,
          vocab,
          is_forward_lm=True
          if args["direction"] == "forward"
          else False,
      )
      model = model.to(args["device"])
      params = [
          param for param in model.parameters() if param.requires_grad
      ]
      optimizer = torch.optim.SGD(
          params,
          lr=args["lr0"],
          momentum=args["momentum"],
          weight_decay=args["weight_decay"],
      )
      criterion = torch.nn.CrossEntropyLoss()
      scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(
          optimizer,
          verbose=True,
          factor=args["anneal"],
          patience=args["patience"],
      )
      return cls(model, params, optimizer, criterion, scheduler)
  
imports: from collections import Counter
  from operator import itemgetter
  import os
  import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_sequence, pad_packed_sequence, pack_padded_sequence, PackedSequence
  from stanza.models.common.data import get_long_tensor
  from stanza.models.common.packed_lstm import PackedLSTM
  from stanza.models.common.utils import open_read_text, tensor_unsort, unsort
  from stanza.models.common.dropout import SequenceUnitDropout
  from stanza.models.common.vocab import UNK_ID, CharVocab
label_desc: Use image node_id 3 for calling the CharacterLanguageModelTrainer obj's underlying member method code with example usage: obj.from_new_model(cls, args, vocab) and returns: cls