I literally read this short story in ... probably Asimov's SF, probably in the 1990s. Could've been Analog.
Seriously, though - this was, like, the entire plot. Exactly this. EXACTLY this.
From https://futurism.com/future-society/anthropic-destroying-books :
Anthropic shredded millions of physical books to train its Claude AI model — and new documents suggest that it was well aware of just how bad it would look if anyone found out.