The customer's sentiment analysis can fully grasp the customer's consumption trends and the popularity of the product. This article takes the restaurant's online reviews as an example and uses machine learning algorithms to analyze the customer's sentiment tendency. The research describes the overall process of sentiment analysis, and discusses the implementation methods of corpus acquisition, feature extraction, feature selection, expanded sentiment dictionary construction, and determination of class labels. The training method of machine learning sentiment analysis model is analyzed. After the experimental analysis of the obtained corpus, the experimental results are given through the chart. The C4.5, Bagging, Multinomial naïve bayes algorithm has achieved good results.