code: def __init__(
      self,
      base_model_class,
      model_class,
      mode="base",
      type="ser",
      pretrained=True,
      checkpoints=None,
      **kwargs,
  ):
      super(NLPBaseModel, self).__init__()
      if checkpoints is not None:  # load the trained model
          self.model = model_class.from_pretrained(checkpoints)
      else:  # load the pretrained-model
          pretrained_model_name = pretrained_model_dict[
              base_model_class
          ][mode]
          if pretrained is True:
              base_model = base_model_class.from_pretrained(
                  pretrained_model_name
              )
          else:
              base_model = base_model_class.from_pretrained(pretrained)
          if type == "ser":
              self.model = model_class(
                  base_model,
                  num_classes=kwargs["num_classes"],
                  dropout=None,
              )
          else:
              self.model = model_class(base_model, dropout=None)
      self.out_channels = 1
      self.use_visual_backbone = True
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from paddle import nn
  from paddlenlp.transformers import LayoutXLMModel, LayoutXLMForTokenClassification, LayoutXLMForRelationExtraction
  from paddlenlp.transformers import LayoutLMModel, LayoutLMForTokenClassification
  from paddlenlp.transformers import LayoutLMv2Model, LayoutLMv2ForTokenClassification, LayoutLMv2ForRelationExtraction
  from paddlenlp.transformers import AutoModel
label_desc: Use image node_id 1 to create a new NLPBaseModel object from inherited base classes: nn with example: obj = NLPBaseModel(base_model_class, model_class, mode, type, pretrained, checkpoints)