Anthropic wins ruling on AI training in copyright lawsuit but must face trial on pirated books