class_docstr: Class which prettifies dependency parser output
  to 10-column (Universal Dependencies) format.
  Args:
      begin: a string to append in the beginning
      end: a string to append in the end
      sep: separator between word analyses
class_docstr_tok: ["Class","which","prettifies","dependency","parser","output","to","10-column","(","Universal","Dependencies",")","format",".","Args",":","begin",":","a","string","to","append","in","the","beginning","end",":","a","string","to","append","in","the","end","sep",":","separator","between","word","analyses"]
docstr: Prettifies output of dependency parser.
  Args:
      tokens: tokenized source sentence
      heads: list of head positions, the output of the parser
      deps: list of head positions, the output of the parser
  Returns:
      the prettified output of the parser
docstr_tok: ["Prettifies","output","of","dependency","parser",".","Args",":","tokens",":","tokenized","source","sentence","heads",":","list","of","head","positions",",","the","output","of","the","parser","deps",":","list","of","head","positions",",","the","output","of","the","parser","Returns",":","the","prettified","output","of","the","parser"]
code: def prettify(
      self, tokens: List[str], heads: List[int], deps: List[str]
  ) -> Union[List[str], str]:
      """Prettifies output of dependency parser.
      Args:
          tokens: tokenized source sentence
          heads: list of head positions, the output of the parser
          deps: list of head positions, the output of the parser
      Returns:
          the prettified output of the parser
      """
      answer = []
      for i, (word, head, dep) in enumerate(zip(tokens, heads, deps)):
          answer.append(
              self.format_string.format(i + 1, word, head, dep)
          )
      if self.return_string:
          answer = self.begin + self.sep.join(answer) + self.end
      return answer
  
file_path: DeepPavlov/deeppavlov/models/morpho_syntax_parser/syntax_parsing.py
imports: from typing import List, Optional, Tuple, Union
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
label_desc: Use image node_id 2 for calling the DependencyOutputPrettifier obj's underlying member method code with example usage: obj.prettify(tokens, heads, deps) and returns: answer