code: def get_deepfm_model(schema, args, prediction_tasks):
      cat_schema = schema.select_by_tag(Tags.CATEGORICAL)
      cat_schema_onehot = cat_schema.remove_by_tag(
          Tags.SEQUENCE
      ).remove_by_tag(Tags.USER_ID)
      cat_schema_multihot = cat_schema.select_by_tag(Tags.SEQUENCE)
  
      input_block = mm.InputBlockV2(
          schema,
          categorical=mm.Embeddings(
              cat_schema,
              dim=args.embeddings_dim,
              embeddings_regularizer=regularizers.l2(
                  args.embeddings_l2_reg
              ),
          ),
          aggregation=None,
      )
  
      wide_inputs_block = {
          "categorical_ohe": mm.SequentialBlock(
              mm.Filter(cat_schema_onehot),
              mm.CategoryEncoding(
                  cat_schema_onehot, sparse=True, output_mode="one_hot"
              ),
          )
      }
  
      if len(cat_schema_multihot) > 0:
          wide_inputs_block["categorical_mhe"] = 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.DeepFMModel(
          cat_schema,
          deep_block=mm.MLPBlock(
              args.mlp_layers,
              activation=args.activation,
              kernel_initializer=args.mlp_init,
              dropout=args.dropout,
              kernel_regularizer=regularizers.l2(args.l2_reg),
              bias_regularizer=regularizers.l2(args.l2_reg),
          ),
          input_block=input_block,
          wide_input_block=mm.ParallelBlock(
              wide_inputs_block, 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 5 for calling a global function with example usage: get_deepfm_model(schema, args, prediction_tasks) and returns: model