The company’s results are likely to ease investors’ worries that big investments in artificial intelligence aren’t paying off.