<jupyter_start><jupyter_text>Graphbrain parserThis notebook is a simple demonstration of the Graphbrain parser, which transforms a sentence in natural language into an hyperedge.<jupyter_code># simple functions to interact with Graphbrain from notebooks
from graphbrain.notebook import *
# the parser
from graphbrain.meaning.parser import Parser
# function to visualize parse trees
from graphbrain.meaning.nlpvis import print_tree<jupyter_output><empty_output><jupyter_text>**Note**: When the cell bellow is run, the parser is initalized. This can take from a few seconds to a minute.<jupyter_code># include part-of-speech tags in atoms
pos = True

# create the parser object
parser = Parser(lang='en', pos=pos)
# change to whatever you like...
text = """
The Turing test, developed by <NAME> in 1950, is a test of machine intelligence.
"""

roots_only = True
compact = False
tree = False

parses = parser.parse(text)
for parse in parses:
    if tree:
        print_tree(parse['spacy_sentence'].root)
    show(parse['main_edge'], roots_only=roots_only, compact=compact)<jupyter_output>[31m*[0m [36mtracking[0m/track/[32mVBG[0m ([33mROOT[0m) 
 +-- [31m<[0m [36msatellites[0m/satellites/[32mNNP[0m ([33mnsubj[0m) [35m{ORG}[0m
 |   +-- [31m<[0m [36m[0m//[32m[0m ([33m[0m) [35m{ORG}[0m
 |   +-- [31m>[0m [36mfrom[0m/from/[32mIN[0m ([33mprep[0m) 
 |       +-- [31m>[0m [36mnasa[0m/nasa/[32mNNP[0m ([33mpobj[0m) [35m{ORG}[0m
 |           +-- [31m>[0m [36mand[0m/and/[32mCC[0m ([33mcc[0m) 
 |           +-- [31m>[0m [36magencies[0m/agency/[32mNNS[0m ([33mconj[0m) 
 |               +-- [31m<[0m [36mother[0m/other/[32mJJ[0m ([33mamod[0m) 
 +-- [31m<[0m [36mhave[0m/have/[32mVBP[0m ([33maux[0m) 
 +-- [31m<[0m [36mbeen[0m/be/[32mVBN[0m ([33maux[0m) 
 +-- [31m>[0m [36mchanges[0m/change/[32mNNS[0m ([33mdobj[0m) 
 |   +-- [31m<[0m [36mice[0m/ice/[32mNN[0m ([33mcompound[0m) 
 |       +-- [31m<[0m [36msea[0m/sea/[32mNN[0m ([33mcompound[0m) 
 +-- [31m>[0m [36msince[0m/since/[32mI[...]
StarcoderdataJupyterStructuredCleanDedup