code: def factory(cls, config):
      model_type = config.model_type
      if model_type == "ERNIESageV1":
          return ERNIESageV1Encoder(config)
      elif model_type == "ERNIESageV2":
          return ERNIESageV2Encoder(config)
      elif model_type == "ERNIESageV3":
          return ERNIESageV3Encoder(config)
      else:
          raise ValueError
  
imports: import os
  import json
  import numpy
  import pgl
  import paddle.fluid
  import paddle.fluid.layers
  from ernie import ErnieModel
  from pgl.utils.logger import log
label_desc: Use image node_id 2 for calling the Encoder obj's underlying member method code with example usage: obj.factory(cls, config) and returns: ERNIESageV1Encoder, ERNIESageV2Encoder, ERNIESageV3Encoder