INNER CODE UNIT · Python
Parser
vacancy/SceneGraphParser · sng_parser/parser.py:19
class Parser(object):
"""
The scene graph parser. To instantiate a scene graph parser,
you need to specify a backend (default: spacy) and the initialization
keyword arguments for the backend (optional).
Once the backend has been specified, you can call parser.parse(sentence)
to parse a sentence in natural language into a scene graph.
Note that, the function `parse` also supports extra keyword arguments
which will be passed to the backend for the parsing.
To use this feature, you may refer to the implementation of your parser
backend.
Example::
>>> parser = Parser(backend, **init_kwargs)
>>> graph = parser.parse('A woman is playing the piano,')
"""