In the example of FIG. 6A, a directed sentence graph 512 is generated where directed edges are connected between the nodes 610 to indicate relationships from words represented by the nodes at the starts of the directed edges to words represented by the nodes at the ends of the directed edges. As shown, there are at least directed edges from the node 610-1 to the node 610-2 due to the “subj” relationship (denoted by “dA”) from “Mary” to “gave”, from the node 610-2 to the node 610-5 due to the “obj” relationship (denoted by “dD”) from “John” to “gave,” from the node 610-4 to the node 610-5 due to the “dnet” relationship (denoted by “dB”) from “a” to “book,” and from the node 610-2 to the node 610-5 due to the “iobj” relationship (denoted by “dc”) from “book” to “gave.” It is noted that the opposite dependency relationships are not indicated by edges in the example of FIG. 6B.
In addition to the syntactic relationships, the graph generation module 510 may generate the sentence graph 512 to further include edges representing a sequential relationship and/or a self-relationship. In an embodiment, in generating the sentence graph 512, the graph generation module 510 may construct one or more edges to connect one or more of the nodes itself, respectively. In this case, the tuple of the edge in the edge set ε is represented as eii=(vi,vi,‘self’), where “self” indicates a label of the self-relationship for the word vi. In some embodiments, the graph generation module 510 may construct respective edges for the nodes in the sentence graph 512 to indicate their self-relationship.