class_docstr: Labeled parser that finds a grammatical relation between two words in a
  sentence. Its input is either a CoNLL2009 or ConllU dataset.
  
  Dependency parsers provide information about word relationship. For example,
  dependency parsing can tell you what the subjects and objects of a verb are,
  as well as which words are modifying (describing) the subject. This can help
  you find precise answers to specific questions.
  
  The parser requires the dependant tokens beforehand with e.g.
  DependencyParser.
  
  Pretrained models can be loaded with :meth:`.pretrained` of the companion
  object:
  
  >>> typedDependencyParser = TypedDependencyParserModel.pretrained() \
  ...     .setInputCols(["dependency", "pos", "token"]) \
  ...     .setOutputCol("dependency_type")
  
  The default model is ``"dependency_typed_conllu"``, if no name is provided.
  For available pretrained models please see the `Models Hub
  <https://sparknlp.org/models>`__.
  
  For extended examples of usage, see the `Examples
  <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/annotation/text/english/graph-extraction/graph_extraction_intro.ipynb>`__.
  
  ========================== ======================
  Input Annotation types     Output Annotation type
  ========================== ======================
  ``TOKEN, POS, DEPENDENCY`` ``LABELED_DEPENDENCY``
  ========================== ======================
  
  Parameters
  ----------
  None
  
  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")
  >>> posTagger = PerceptronModel.pretrained() \
  ...     .setInputCols(["sentence", "token"]) \
  ...     .setOutputCol("pos")
  >>> dependencyParser = DependencyParserModel.pretrained() \
  ...     .setInputCols(["sentence", "pos", "token"]) \
  ...     .setOutputCol("dependency")
  >>> typedDependencyParser = TypedDependencyParserModel.pretrained() \
  ...     .setInputCols(["dependency", "pos", "token"]) \
  ...     .setOutputCol("dependency_type")
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     sentence,
  ...     tokenizer,
  ...     posTagger,
  ...     dependencyParser,
  ...     typedDependencyParser
  ... ])
  >>> data = spark.createDataFrame([[
  ...     "Unions representing workers at Turner Newall say they are 'disappointed' after talks with stricken parent " +
  ...       "firm Federal Mogul."
  ... ]]).toDF("text")
  >>> result = pipeline.fit(data).transform(data)
  >>> result.selectExpr("explode(arrays_zip(token.result, dependency.result, dependency_type.result)) as cols") \
  ...     .selectExpr("cols['0'] as token", "cols['1'] as dependency", "cols['2'] as dependency_type") \
  ...     .show(8, truncate = False)
  +------------+------------+---------------+
  |token       |dependency  |dependency_type|
  +------------+------------+---------------+
  |Unions      |ROOT        |root           |
  |representing|workers     |amod           |
  |workers     |Unions      |flat           |
  |at          |Turner      |case           |
  |Turner      |workers     |flat           |
  |Newall      |say         |nsubj          |
  |say         |Unions      |parataxis      |
  |they        |disappointed|nsubj          |
  +------------+------------+---------------+
docstr: Downloads and loads a pretrained model.
  
  Parameters
  ----------
  name : str, optional
      Name of the pretrained model, by default "dependency_typed_conllu"
  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
  -------
  TypedDependencyParserModel
      The restored model
code: def pretrained(
      name="dependency_typed_conllu", lang="en", remote_loc=None
  ):
      """Downloads and loads a pretrained model.
  
      Parameters
      ----------
      name : str, optional
          Name of the pretrained model, by default "dependency_typed_conllu"
      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
      -------
      TypedDependencyParserModel
          The restored model
      """
      from sparknlp.pretrained import ResourceDownloader
  
      return ResourceDownloader.downloadModel(
          TypedDependencyParserModel, name, lang, remote_loc
      )
  
file_path: spark-nlp/python/sparknlp/annotator/dependency/typed_dependency_parser.py
imports: from sparknlp.common import *
label_desc: Use image node_id 2 for calling the TypedDependencyParserModel obj's underlying member method code with example usage: obj.pretrained(name, lang, remote_loc) and returns: ResourceDownloader