As shown in the example sentence graph 512 in
In an embodiment, to include edges indicating the sequential relationship, the graph generation module 510 may generate the sentence graph 512 further based on the sequential order of the words in the sentence 402. The sequential relationship between the words is also important since a word and its surrounding words may together constitute a phrase. In some embodiments, the syntactic relationship may prioritize the sequential relationship. More specifically, for any two words in the sentence 402, the graph generation module 510 may first determine whether there is a syntactic relationship between the two words. If the graph generation module 510 determines that there is no syntactic relationship between two words in the sentence 402, this module may further determine whether the two words are adjacent to each other (for example, one word is immediately followed by the other) in the sentence 402. If the two words are adjacent to each other, the graph generation module 510 may construct an edge in the sentence graph 512 to connect two of the nodes representing the two words. This edge may indicate a sequential relationship between the two words.