class_docstr: Trains an unlabeled parser that finds a grammatical relations between two
  words in a sentence.
  
  For instantiated/pretrained models, see :class:`.DependencyParserModel`.
  
  Dependency parser provides 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 required training data can be set in two different ways (only one can be
  chosen for a particular model):
  
  - Dependency treebank in the
    `Penn Treebank format <http://www.nltk.org/nltk_data/>`__ set with
    ``setDependencyTreeBank``
  - Dataset in the
    `CoNLL-U format <https://universaldependencies.org/format.html>`__ set
    with ``setConllU``
  
  Apart from that, no additional training data is needed.
  
  ======================== ======================
  Input Annotation types   Output Annotation type
  ======================== ======================
  ``DOCUMENT, POS, TOKEN`` ``DEPENDENCY``
  ======================== ======================
  
  Parameters
  ----------
  dependencyTreeBank
      Dependency treebank source files
  conllU
      Universal Dependencies source files
  numberOfIterations
      Number of iterations in training, converges to better accuracy,
      by default 10
  
  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")
  >>> dependencyParserApproach = DependencyParserApproach() \
  ...     .setInputCols(["sentence", "pos", "token"]) \
  ...     .setOutputCol("dependency") \
  ...     .setDependencyTreeBank("src/test/resources/parser/unlabeled/dependency_treebank")
  >>> pipeline = Pipeline().setStages([
  ...     documentAssembler,
  ...     sentence,
  ...     tokenizer,
  ...     posTagger,
  ...     dependencyParserApproach
  ... ])
  >>> emptyDataSet = spark.createDataFrame([[""]]).toDF("text")
  >>> pipelineModel = pipeline.fit(emptyDataSet)
  
  Additional training data is not needed, the dependency parser relies on the
  dependency tree bank / CoNLL-U only.
  
  See Also
  --------
  TypedDependencyParserApproach : to extract labels for the dependencies
docstr: Sets Universal Dependencies source files.
  
  Parameters
  ----------
  path : str
      Path to the source files
  read_as : str, optional
      How to read the file, by default ReadAs.TEXT
  options : dict, optional
      Options to read the resource, by default {"key": "value"}
code: def setConllU(
      self, path, read_as=ReadAs.TEXT, options={"key": "value"}
  ):
      """Sets Universal Dependencies source files.
  
      Parameters
      ----------
      path : str
          Path to the source files
      read_as : str, optional
          How to read the file, by default ReadAs.TEXT
      options : dict, optional
          Options to read the resource, by default {"key": "value"}
      """
      opts = options.copy()
      return self._set(conllU=ExternalResource(path, read_as, opts))
  
file_path: spark-nlp/python/sparknlp/annotator/dependency/dependency_parser.py
imports: from sparknlp.common import *
label_desc: Use image node_id 4 for calling the DependencyParserApproach obj's underlying member method code with example usage: obj.setConllU(path, read_as, options) and returns: self