US judge allows company to train AI using copyrighted literary materials