Also please don't use word "learning", use "creating software using copyrighted materials".
Also let's think together how can we prevent AI companies from using our work using technical measures if the law doesn't work?
You are allowed to buy and scan books, and then used those scanned books to create products. I guess you are also allowed to pirate books and use the knowledge to create products if you are willing to pay the damages to the rights holders for copyright violations.