Microsoft Corp. reached a deal with News Corp.’s HarperCollins that will allow the software company to use nonfiction titles from the book publisher to train its artificial intelligence models, ...