to_json

ucca.convert.to_json(passage, *args, return_dict=False, tok_task=None, all_categories=None, skip_category_mapping=False, **kwargs)[source]

Convert a Passage object to text (or dict) in UCCA-App JSON :param passage: the Passage object to convert :param return_dict: whether to return dict rather than list of lines :param tok_task: either None (to do tokenization too), or a completed tokenization task dict with token IDs,

or True, to indicate that the function should do only tokenization and not annotation
Parameters:
  • all_categories – list of category dicts so that IDs can be added, if available - otherwise names are used
  • skip_category_mapping – if False, translate edge tag abbreviations to category names; if True, don’t
Returns:

list of lines in JSON format if return_dict=False, or task dict if True