code: def test_json_keras():
      """Test case for JSONDataset with keras."""
      feature_filename = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          "test_json",
          "iris.json",
      )
      feature_filename = "file://" + feature_filename
      label_filename = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          "test_json",
          "species.json",
      )
      label_filename = "file://" + label_filename
  
      feature_cols = [
          "sepalLength",
          "sepalWidth",
          "petalLength",
          "petalWidth",
      ]
      label_cols = ["species"]
  
      feature_dataset = tfio.IODataset.from_json(
          feature_filename, feature_cols, mode="records"
      )
  
      label_dataset = tfio.IODataset.from_json(
          label_filename, label_cols, mode="records"
      )
  
      dataset = tf.data.Dataset.zip((feature_dataset, label_dataset))
      dataset = dataset.batch(1)
  
      def pack_features_vector(features, labels):
          """Pack the features into a single array."""
          features = tf.stack(list(features), axis=1)
          return features, labels
  
      dataset = dataset.map(pack_features_vector)
  
      model = tf.keras.Sequential(
          [
              tf.keras.layers.Dense(
                  10, activation=tf.nn.relu, input_shape=(4,)
              ),  # input shape required
              tf.keras.layers.Dense(10, activation=tf.nn.relu),
              tf.keras.layers.Dense(3),
          ]
      )
  
      model.compile(
          optimizer="adam",
          loss="binary_crossentropy",
          metrics=["accuracy"],
      )
      model.fit(dataset, epochs=5)
  
file_path: io/tests/test_json.py
imports: import os
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 4 for calling a global function with example usage: test_json_keras() and returns: features,  labels