In some embodiments of generating a directed sentence graph 512, for any two adjacent words, the graph generation module 510 may determine whether there are a first syntactic relationship from a first one of the two words to a second one of the two words and a second syntactic relationship from the second word to the first word. In response to only the first syntactic relationship being determined, the graph generation module 510 may construct a directed edge from a first node representing the first word to a second node representing the second word to indicate the first syntactic relationship, and then construct a further directed edge from the second node to the first node to indicate the sequential relationship from the second word to the first word.
In response to only the second syntactic relationship being determined, the graph generation module 510 may construct a directed edge from the second node to the first node to indicate the second syntactic relationship, and then construct a further directed edge from the first node to the second node to indicate the sequential relationship from the first word to the second word. Alternatively, in the case where neither of the two syntactic relationships is determined, the graph generation module 510 may construct two directed edges from the first node to the second node and from the second node to the first node, respectively.