FIGS. 6A and 6B illustrate some examples of the sentence graph 512 generated from the sentence 402. In the examples of FIGS. 6A and 6B, the sentence 402 input to the encoder 410 is “Mary gave John a book.” As shown, the syntactic relationship between the word “Mary” and the word “gave” is a subject relationship (represented by a label “sub”), indicating that the word “Mary” is a subject of the word “gave.” The syntactic relationship between the word “gave” and the word “John” is an indirect object relationship (represented by a label “iobj”), indicating that the word “John” is an indirect object of the word “gave.” The syntactic relationship between the word “a” and the word “book” is a numeric-determiner modifier relationship (represented by a label “dnet”), indicating that the word “a” is a numeric-determiner modifier of the word “book.” Further, the syntactic relationship between the word “gave” and the word “book” is an object relationship (represented by a label “obj”), indicating that the word “book” is an object of the word “gave.”
Depending on the dependency relationships between the words in the sentence 402, the graph generation module 510 may generate the sentence graph 512. In the sentence graph 512, there are nodes 610-1, 610-2, 610-3, 610-4, and 610-5 representing the words “Mary,” “gave,” “John,” “a,” “book,” respectively. For ease of discussion, the nodes 610-1, 610-2, 610-3, 610-4, and 610-5 may sometimes be collectively or individually referred to as nodes 610.