Methods, systems, and apparatus, including computer programs language encoded on a computer storage medium for a logic sentence length reduction system whereby input text is modified to a logical and grammatical state using a reinforcement learning system with a real-time grammar engine and a real-time logic engine. The logic sentence length reduction system breaks sentences into fragments. An agent performs actions to each sentence fragment such that fragments are reconstructed into complete sentences. The real-time logic and real-time grammar engine are provided a reward for producing a grammatical and logical sentence. The reinforcement-learning agent optimizes a policy to reconstruct logical and grammatical sentences from sentence fragments maximizing future reward.
Reinforcement learning approach to decode sentence ambiguity