from_conllu

semstr.convert.from_conllu(lines, passage_id=None, return_original=False, annotate=False, terminals_only=False, dep=False, enhanced=True, preprocess=True, **kwargs)[source]

Converts from parsed text in Universal Dependencies format to a Passage object.

Parameters:
  • lines – iterable of lines in Universal Dependencies format, describing a single passage.
  • passage_id – ID to set for passage
  • return_original – return triple of (UCCA passage, Universal Dependencies string, sentence ID)
  • annotate – whether to save dependency annotations in “extra” dict of layer 0
  • terminals_only – create only terminals (with any annotation if specified), no non-terminals
  • dep – return dependency graph rather than converted UCCA passage
  • enhanced – whether to include enhanced edges
  • preprocess – preprocess the dependency graph before converting to UCCA (or returning it)?

:return generator of Passage objects