Duke Energy is using artificial intelligence to detect scams that target customers, the company said Thursday.