The company plans to off thousands of people as AI changes the way people work.