code: def build_model(
      model_type, sparse_features, dense_features, feature_max_idx
  ):
      sparse_feature_columns = [
          SparseFeat(feat, feature_max_idx[feat], embedding_dim="auto")
          for feat in sparse_features
      ]
      dense_feature_columns = [
          DenseFeat(feat, 1) for feat in dense_features
      ]
      dnn_features_columns = (
          sparse_feature_columns + dense_feature_columns
      )
      if model_type == "mmoe":
          model = MMOE(
              dnn_features_columns,
              tower_dnn_hidden_units=[],
              task_types=["regression", "binary"],
              task_names=["duration", "click"],
          )
      elif model_type == "ple":
          model = PLE(
              dnn_features_columns,
              shared_expert_num=1,
              specific_expert_num=1,
              task_types=["regression", "binary"],
              num_levels=2,
              task_names=["duration", "click"],
          )
      else:
          invalidInputError(
              False,
              'model_type should be one of "mmoe" and "ple", '
              "but got " + model_type,
          )
      return model
  
file_path: BigDL/python/friesian/example/multi_task/run_multi_task.py
imports: import math
  from time import time
  from argparse import ArgumentParser
  from bigdl.dllib.utils.log4Error import invalidInputError
  from bigdl.orca import init_orca_context, stop_orca_context
  from bigdl.orca.learn.tf2.estimator import Estimator
  from bigdl.friesian.feature import FeatureTable
  from deepctr.feature_column import SparseFeat, DenseFeat
  from deepctr.models import MMOE, PLE
  from keras.callbacks import EarlyStopping
label_desc: Use image node_id 1 for calling a global function with example usage: build_model(model_type, sparse_features, dense_features, feature_max_idx) and returns: model