Given to the increasing traffic volume in ports in recent years, ship selection and inspection procedure in the port state control (PSC) should be improved to reduce any unnecessary delay caused by the inefficient inspections. This study aims to newly use a data training technique and the newest PSC data to improve the usage of Bayesian Network (BN) to assess detention risk to a point where risk factors are identified, interrelationships among the factors are analysed and prior probability training based on big data is obtained more easily. To construct the BN model, a Bayesian theorem-based machine learning approach is adopted to ensure the obtained model is objective and reliable. The model is developed based on 1880 inspection records in the Paris Memorandum of Understanding (MoU) regime between 1st January 2017 and 31st March 2020. The obtained model not only present the probability distribution of each factor but also explore interrelationships among them. Compared to the Ship Risk Profiles (SRP) model, the used data-driven structure learning algorithm is more convenient and useful. The analysis results provide insights for ship owners to manage ship detention risk while support port authorities to prioritize the ship checklist and utilise more efficient ship inspection.