class_docstr: A coreference resolution model based on SpanBert.
  
  A coreference resolution model identifies expressions which refer to the same entity in a text. For example, given
  a sentence "John told Mary he would like to borrow a book from her." the model will link "he" to "John" and "her"
  to "Mary".
  
  This model is based on SpanBert, which is fine-tuned on the OntoNotes 5.0 data set.
  
  Pretrained models can be loaded with :meth:`.pretrained` of the companion object:
  
  >>> corefResolution = SpanBertCorefModel.pretrained() \
  ...     .setInputCols(["sentence", "token"]) \
  ...     .setOutputCol("coref")
  
  The default model is ``"spanbert_base_coref"``, if no name is provided. For available
  pretrained models please see the `Models Hub
  <https://sparknlp.org/models?q=coref>`__.
  
  For extended examples of usage, see the
  `Examples <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/annotation/text/english/coreference-resolution/Coreference_Resolution_SpanBertCorefModel.ipynb>`__.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``DOCUMENT, TOKEN``    ``DEPENDENCY``
  ====================== ======================
  
  Parameters
  ----------
  maxSentenceLength
      Maximum sentence length to process
  maxSegmentLength
      Maximum segment length
  textGenre
      Text genre. One of the following values:
  
      | "bc", // Broadcast conversation, default
      | "bn", // Broadcast news
      | "nw", // News wire
      | "pt", // Pivot text: Old Testament and New Testament text
      | "tc", // Telephone conversation
      | "wb" // Web data
  
  Examples
  --------
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("document")
  >>> sentence = SentenceDetector() \
  ...     .setInputCols(["document"]) \
  ...     .setOutputCol("sentence")
  >>> tokenizer = Tokenizer() \
  ...     .setInputCols(["sentence"]) \
  ...     .setOutputCol("token")
  >>> corefResolution = SpanBertCorefModel() \
  ...     .pretrained() \
  ...     .setInputCols(["sentence", "token"]) \
  ...     .setOutputCol("corefs") \
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     sentence,
  ...     tokenizer,
  ...     corefResolution
  ... ])
  >>> data = spark.createDataFrame([
  ...     ["John told Mary he would like to borrow a book from her."]
  ... ]).toDF("text")
  >>> results = pipeline.fit(data).transform(data))
  >>> results \
  ...     .selectExpr("explode(corefs) AS coref")
  ...     .selectExpr("coref.result as token", "coref.metadata")
  ...     .show(truncate=False)
  +-----+------------------------------------------------------------------------------------+
  |token|metadata                                                                            |
  +-----+------------------------------------------------------------------------------------+
  |John |{head.sentence -> -1, head -> ROOT, head.begin -> -1, head.end -> -1, sentence -> 0}|
  |he   |{head.sentence -> 0, head -> John, head.begin -> 0, head.end -> 3, sentence -> 0}   |
  |Mary |{head.sentence -> -1, head -> ROOT, head.begin -> -1, head.end -> -1, sentence -> 0}|
  |her  |{head.sentence -> 0, head -> Mary, head.begin -> 10, head.end -> 13, sentence -> 0} |
  +-----+------------------------------------------------------------------------------------|
docstr: Downloads and loads a pretrained model.
  
  Parameters
  ----------
  name : str, optional
      Name of the pretrained model, by default "spanbert_base_coref"
  lang : str, optional
      Language of the pretrained model, by default "en"
  remote_loc : str, optional
      Optional remote address of the resource, by default None. Will use
      Spark NLPs repositories otherwise.
  
  Returns
  -------
  SpanBertCorefModel
      The restored model
docstr_tok: ["Downloads","and","loads","a","pretrained","model",".","Parameters","--","--","--","--","--","name",":","str",",","optional","Name","of","the","pretrained","model",",","by","default","``","spanbert_base_coref","''","lang",":","str",",","optional","Language","of","the","pretrained","model",",","by","default","``","en","''","remote_loc",":","str",",","optional","Optional","remote","address","of","the","resource",",","by","default","None",".","Will","use","Spark","NLPs","repositories","otherwise",".","Returns","--","--","--","-","SpanBertCorefModel","The","restored","model"]
code: def pretrained(
      name="spanbert_base_coref", lang="en", remote_loc=None
  ):
      """Downloads and loads a pretrained model.
  
      Parameters
      ----------
      name : str, optional
          Name of the pretrained model, by default "spanbert_base_coref"
      lang : str, optional
          Language of the pretrained model, by default "en"
      remote_loc : str, optional
          Optional remote address of the resource, by default None. Will use
          Spark NLPs repositories otherwise.
  
      Returns
      -------
      SpanBertCorefModel
          The restored model
      """
      from sparknlp.pretrained import ResourceDownloader
  
      return ResourceDownloader.downloadModel(
          SpanBertCorefModel, name, lang, remote_loc
      )
  
file_path: spark-nlp/python/sparknlp/annotator/coref/spanbert_coref.py
imports: from sparknlp.common import *
label_desc: Use image node_id 6 for calling the SpanBertCorefModel obj's underlying member method code with example usage: obj.pretrained(name, lang, remote_loc) and returns: ResourceDownloader