8. The method of claim 5 , further comprising: receiving, by the computer, another context associated with a user action after the best task is output; and using, by the computer, the other context to train the ranking algorithm.
5. A method for reasoning an action based on a natural language input, the method comprising: receiving, by a computer, a query, a user context, and feedback associated with prior slot assignments, the user context being information indicative of previous actions of a user; transforming, by the computer, subsets of the query into tokens; retrieving, by the computer, a plurality of tasks utilizing the tokens and the user context, each task in the plurality of tasks being relevant to the query, each task in the plurality of tasks having slots to hold pieces of information about the task; scoring, by the computer, each task in the plurality of tasks to select a best task based at least on the query and the user context; generating, by the computer, semantic solutions for the best task, the semantic solutions for the best task mapping ones of the tokens into the slots of the best task; using a ranking algorithm to rank the semantic solutions for the best task based at least in part on the feedback; outputting, by the computer, the best task and a best semantic solution, the best semantic solution being a highest-ranking one of the semantic solutions for the best task; and employing, by the computer, the best semantic solution as feedback to train the ranking algorithm.