code: def build_spancat_model(
      tok2vec: Model[List[Doc], List[Floats2d]],
      reducer: Model[Ragged, Floats2d],
      scorer: Model[Floats2d, Floats2d],
  ) -> Model[Tuple[List[Doc], Ragged], Floats2d]:
      """Build a span categorizer model, given a token-to-vector model, a
      reducer model to map the sequence of vectors for each span down to a single
      vector, and a scorer model to map the vectors to probabilities.
  
      tok2vec (Model[List[Doc], List[Floats2d]]): The tok2vec model.
      reducer (Model[Ragged, Floats2d]): The reducer model.
      scorer (Model[Floats2d, Floats2d]): The scorer model.
      """
      model = chain(
          cast(
              Model[Tuple[List[Doc], Ragged], Tuple[Ragged, Ragged]],
              with_getitem(
                  0,
                  chain(
                      tok2vec,
                      cast(
                          Model[List[Floats2d], Ragged], list2ragged()
                      ),
                  ),
              ),
          ),
          extract_spans(),
          reducer,
          scorer,
      )
      model.set_ref("tok2vec", tok2vec)
      model.set_ref("reducer", reducer)
      model.set_ref("scorer", scorer)
      return model
  
file_path: spacy/spacy/ml/models/spancat.py
imports: from typing import List, Tuple, cast
  from thinc.api import Linear, Logistic, Maxout, Model, chain, concatenate, glorot_uniform_init, list2ragged, reduce_first, reduce_last, reduce_max, reduce_mean, with_getitem
  from thinc.types import Floats2d, Ragged
  from ...tokens import Doc
  from ...util import registry
  from ..extract_spans import extract_spans
label_desc: Use image node_id 3 for calling a global function with example usage: build_spancat_model(tok2vec, reducer, scorer) and returns: model