code: def build_model(model_type, n_uid, n_mid, n_cat, lr, data_type):
      if model_type == "DNN":
          model = Model_DNN(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "PNN":
          model = Model_PNN(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "Wide":
          model = Model_WideDeep(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "DIN":
          model = Model_DIN(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "DIN-V2-gru-att-gru":
          model = Model_DIN_V2_Gru_att_Gru(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "DIN-V2-gru-gru-att":
          model = Model_DIN_V2_Gru_Gru_att(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "DIN-V2-gru-qa-attGru":
          model = Model_DIN_V2_Gru_QA_attGru(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "DIN-V2-gru-vec-attGru":
          model = Model_DIN_V2_Gru_Vec_attGru(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
          )
      elif model_type == "DIEN":
          model = Model_DIN_V2_Gru_Vec_attGru_Neg(
              n_uid,
              n_mid,
              n_cat,
              EMBEDDING_DIM,
              HIDDEN_SIZE,
              ATTENTION_SIZE,
              lr,
              data_type,
          )
      else:
          print("Invalid model_type: %s", model_type)
          sys.exit(1)
      return model
  
file_path: BigDL/python/friesian/example/dien/dien_train.py
imports: import argparse
  import time
  import os
  import sys
  from pyspark.ml.evaluation import BinaryClassificationEvaluator
  from pyspark.sql.functions import desc, rank, col, udf
  from pyspark.sql.window import Window
  from bigdl.friesian.feature import FeatureTable
  from bigdl.orca.data.file import exists, makedirs
  from bigdl.orca.learn.tf.estimator import Estimator
  from bigdl.orca import init_orca_context, stop_orca_context
  from model import *
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 1 for calling a global function with example usage: build_model(model_type, n_uid, n_mid, n_cat, lr, data_type) and returns: model