class_docstr: Coref model for a single edge. Compatible with EdgeFeaturesDataset.
class_docstr_tok: ["Coref","model","for","a","single","edge",".","Compatible","with","EdgeFeaturesDataset","."]
docstr: Construct a Keras model using the Functional API.
docstr_tok: ["Construct","a","Keras","model","using","the","Functional","API","."]
code: def build_model(self, input_dim: int, hidden_dim: int = 256):
      """Construct a Keras model using the Functional API."""
      span1_input = tf.keras.Input(shape=[input_dim])
      span2_input = tf.keras.Input(shape=[input_dim])
      concat_input = tf.keras.layers.Concatenate(axis=-1)(
          [span1_input, span2_input]
      )
      h_repr = tf.keras.layers.Dense(hidden_dim, activation="relu")(
          concat_input
      )
      probas = tf.keras.layers.Dense(1, activation="sigmoid")(h_repr)
      return tf.keras.Model(
          inputs={"span1_embs": span1_input, "span2_embs": span2_input},
          outputs=[probas],
          name="coref_model",
      )
  
imports: import os
  from collections.abc import Iterable
  from typing import Optional
  from absl import logging
  from lit_nlp.api import dataset
  from lit_nlp.api import dtypes
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import utils
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling the SingleEdgePredictor obj's underlying member method code with example usage: obj.build_model(input_dim, hidden_dim) and returns: tf