<jupyter_start><jupyter_text>Tree reader<jupyter_code>from lambeq import BobcatParser, TreeReader, TreeReaderMode
sentence = 'John walks in the park.'
reader = TreeReader(ccg_parser=BobcatParser, mode = TreeReaderMode.NO_TYPE)
reader.sentence2diagram(sentence=sentence).draw()
reader = TreeReader(ccg_parser=BobcatParser, mode=TreeReaderMode.RULE_ONLY)
reader.sentence2diagram(sentence).draw()
reader = TreeReader(ccg_parser=BobcatParser, mode=TreeReaderMode.RULE_TYPE)
reader.sentence2diagram(sentence).draw()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1037037037037037, 'fraction_numerical': 0.005555555555555556, 'mean_word_length': 12.195121951219512, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '281160', 'license': 'Apache-2.0', 'n_tokens_mistral': 190, 'n_tokens_neox': 177, 'n_words': 26, 'path': 'docs/examples/tree_reader.ipynb', 'repo_name': 'CQCL/lambeq', 'size': '540'}