The UK will become an "AI maker not an AI taker", according the prime minister, as he announced millions of pounds of funding to train students in AI.