Advertising, AI help China's Baidu beat expectations for revenue