dependency_parser = StanfordDependencyParser(path_to_jar=path_to_jar,
    path_to_models_jar=path_to_models_jar)
result = dependency_parser.raw_parse('I shot an elephant in my sleep')
dep = next(result)
How do I do dependency parsing in NLTK?