When you think about artificial intelligence, two competing images come to mind. One is of the friendly digital assistant who lives and travels with you—Amazon’s Alexa and Apple’s Siri—whose job is to make your life easier. The other is more menacing: the dispassionate robot who is coming to take your job.