Assessment of risk before lung resection surgery can provide anesthesiologists with information about whether a patient can be weaned from the ventilator immediately after surgery. However, it is difficult for anesthesiologists to perform a complete integrated risk assessment in a time-limited pre-anesthetic clinic. We retrospectively collected the electronic medical records of 709 patients who underwent lung resection between 1 January 2017 and 31 July 2019. We used the obtained data to construct an artificial intelligence (AI) prediction model with seven supervised machine learning algorithms to predict whether patients could be weaned immediately after lung resection surgery. The AI model with Naive Bayes Classifier algorithm had the best testing result and was therefore used to develop an application to evaluate risk based on patients' previous medical data, to assist anesthesiologists, and to predict patient outcomes in pre-anesthetic clinics. The individualization and digitalization characteristics of this AI application could improve the effectiveness of risk explanations and physician-patient communication to achieve better patient comprehension.