Alibaba has scored a prized deal as it tries to carve out a lead in the highly competitive artificial intelligence race.