Machines can already write music and beat us at games like chess and Go. But the rise of artificial intelligence…