I am trying to implement the process as shown in the below image for text summarization:

I have understood that the second step is the generating the dependency graph using the Stanford Parser. Here is the code:
from nltk.parse.stanford import StanfordDependencyParser
path_to_jar = 'path_to/stanford-parser-full-2014-08-27/stanford-parser.jar'
path_to_models_jar = 'path_to/stanford-parser-full-2014-08-27/stanford-parser-3.4.1-models.jar'
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 = result.next()
list(dep.triples())
But the part what I am not able to get is the third and fourth. Kindly help me understand it. If possible what is the possible implementation of the third and fourth. Kindly, help me.