Integration Of Machine and deep learning to apps

So i have been learning about deep learning and machine learning for a while and i am having trouble understanding how to integrate them on apps,I know that we can deploy them using Flask but what i am really confused on how do these models improve in real time,lets take google keyboard for example ,it improves itself the more we use it,i read that it uses ML ,So how do we create those kinds of models,because training each time user types something new would be computationally expensive