code: def get_wide_and_deep_model(schema, args, prediction_tasks):
      cat_schema = schema.select_by_tag(Tags.CATEGORICAL)
      cat_schema_multihot = cat_schema.select_by_tag(
          Tags.SEQUENCE
      ).remove_by_tag(Tags.USER_ID)
      cat_schema_onehot = cat_schema.remove_by_tag(
          Tags.SEQUENCE
      ).remove_by_tag(Tags.USER_ID)
  
      deep_embedding = mm.Embeddings(
          cat_schema,
          embeddings_regularizer=regularizers.l2(
              args.embeddings_l2_reg
          ),
          infer_dim_fn=partial(
              infer_embedding_dim,
              multiplier=args.embedding_sizes_multiplier,
          ),
      )
  
      ignore_combinations = None
      if args.wnd_ignore_combinations:
          ignore_combinations = [
              x.split(":") for x in args.wnd_ignore_combinations
          ]
  
      wide_preprocess = [
          # One-hot features
          mm.SequentialBlock(
              mm.Filter(cat_schema_onehot),
              mm.CategoryEncoding(
                  cat_schema_onehot, sparse=True, output_mode="one_hot"
              ),
          ),
          # 2nd level feature interactions of multi-hot features
          mm.SequentialBlock(
              mm.Filter(cat_schema.remove_by_tag(Tags.USER_ID)),
              mm.ToDense(cat_schema.remove_by_tag(Tags.USER_ID)),
              mm.HashedCrossAll(
                  cat_schema.remove_by_tag(Tags.USER_ID),
                  num_bins=args.wnd_hashed_cross_num_bins,
                  max_level=2,
                  output_mode="multi_hot",
                  sparse=True,
                  ignore_combinations=ignore_combinations,
              ),
          ),
      ]
      if len(cat_schema_multihot) > 0:
          wide_preprocess.append(
              mm.SequentialBlock(
                  mm.Filter(cat_schema_multihot),
                  mm.ToDense(cat_schema_multihot),
                  mm.CategoryEncoding(
                      cat_schema_multihot,
                      sparse=True,
                      output_mode="multi_hot",
                  ),
              )
          )
  
      model = mm.WideAndDeepModel(
          schema,
          deep_input_block=mm.InputBlockV2(
              schema=cat_schema, categorical=deep_embedding
          ),
          deep_block=mm.MLPBlock(
              args.mlp_layers,
              dropout=args.dropout,
              kernel_regularizer=regularizers.l2(args.l2_reg),
              bias_regularizer=regularizers.l2(args.l2_reg),
          ),
          wide_schema=schema.remove_by_tag(Tags.TARGET),
          deep_regularizer=regularizers.l2(args.l2_reg),
          wide_regularizer=regularizers.l2(args.wnd_wide_l2_reg),
          wide_dropout=args.dropout,
          deep_dropout=args.dropout,
          wide_preprocess=mm.ParallelBlock(
              wide_preprocess,
              aggregation="concat",
          ),
          prediction_tasks=prediction_tasks,
      )
  
      return model
  
file_path: Merlin/examples/quick_start/scripts/ranking/ranking_models.py
imports: from functools import partial
  import merlin.models.tf
  from merlin.models.tf import Model
  from merlin.models.utils.schema_utils import infer_embedding_dim
  from merlin.schema.tags import Tags
  from tensorflow.keras import regularizers
label_desc: Use image node_id 6 for calling a global function with example usage: get_wide_and_deep_model(schema, args, prediction_tasks) and returns: model