code: def train(save_path: str):
      """Train a coreference model using encoder features over OntoNotes."""
      # Load OntoNotes data for training.
      ontonotes_train = ontonotes.OntonotesCorefDataset(
          os.path.join(FLAGS.ontonotes_edgeprobe_path, "train.json")
      )
      ontonotes_dev = ontonotes.OntonotesCorefDataset(
          os.path.join(
              FLAGS.ontonotes_edgeprobe_path, "development.json"
          )
      )
  
      # Assemble our model.
      encoder = encoders.BertEncoderWithOffsets(FLAGS.encoder_name)
      input_dim = encoder.model.config.hidden_size
      classifier = edge_predictor.SingleEdgePredictor(
          input_dim=input_dim, hidden_dim=min(input_dim, 256)
      )
      full_model = model.FrozenEncoderCoref(encoder, classifier)
  
      # Train our model.
      train_dataset = symmetrize_edges(ontonotes_train)
      full_model.train(
          train_dataset.examples,
          ontonotes_dev.examples,
          batch_size=128,
          num_epochs=15,
      )
      # Save classifier and encoder
      full_model.save(save_path)
  
imports: from collections.abc import Sequence
  import os
  import sys
  from typing import Optional
  from absl import app
  from absl import flags
  from absl import logging
  from lit_nlp import dev_server
  from lit_nlp import server_flags
  from lit_nlp.api import dataset
  from lit_nlp.api import dtypes
  from lit_nlp.api import layout
  from lit_nlp.api import types
  from lit_nlp.examples.coref import edge_predictor
  from lit_nlp.examples.coref import encoders
  from lit_nlp.examples.coref import model
  from lit_nlp.examples.coref.datasets import ontonotes
  from lit_nlp.examples.coref.datasets import winogender
  from lit_nlp.lib import file_cache
  from lit_nlp.lib import utils
label_desc: Use image node_id 3 for calling a global function with example usage: train(save_path) without return types