摘要 |
In one embodiment, a method includes accessing a social graph that includes a plurality of nodes and edges, receiving an unstructured text query, identifying nodes and edges that correspond to portions of the text query, accessing a context-free grammar model, identifying query tokens from the grammar model that correspond to the identified nodes and edges, selecting grammars having query tokens that corresponding to each of the identified nodes and edges, and generating structured queries based on the selected grammars, where the structure queries are based on strings generated by the grammars. |