Last year, Amazon scrapped its machine-learning algorithm because it discovered it had a major problem—the artificial intelligence didn't like women.