class_docstr: Class for training a Masked Language Model. It also supports an
  additional sentence level prediction if the sent-loss argument is set.
class_docstr_tok: ["Class","for","training","a","Masked","Language","Model",".","It","also","supports","an","additional","sentence","level","prediction","if","the","sent-loss","argument","is","set","."]
docstr: Build a new model instance.
docstr_tok: ["Build","a","new","model","instance","."]
code: def build_model(cls, args, task):
      """Build a new model instance."""
      # make sure all arguments are present in older models
      base_architecture(args)
  
      if not safe_hasattr(args, "max_positions"):
          args.max_positions = args.tokens_per_sample
  
      logger.info(args)
  
      encoder = MaskedLMEncoder(args, task.dictionary)
      return cls(args, encoder)
  
imports: import logging
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqEncoder, FairseqEncoderModel, register_model, register_model_architecture
  from fairseq.modules import LayerNorm, SinusoidalPositionalEmbedding, TransformerSentenceEncoder
  from fairseq.modules.transformer_sentence_encoder import init_bert_params
  from fairseq.utils import safe_hasattr
label_desc: Use image node_id 5 for calling the MaskedLMModel obj's underlying member method code with example usage: obj.build_model(cls, args, task) and returns: cls