An apparatus comprising at least one processor and at least one non-transitory memory comprising program code, the at least one non-transitory memory and the program code configured to, with the at least one processor, cause the apparatus to at least:
- receive user query data comprising an input text string;
- generate, based at least in part on the input text string, a n-gram set comprising a plurality of n-gram elements;
- traverse each n-gram element in the n-gram set to generate a parse tree list comprising one or more parse trees based on a grammar template associated with the input text string;
- and
- generate, based at least in part on a last parse tree of the parse tree list, one or more semantic frames indicating a temporal expression associated with the input text string.