The detection of lung cancer is a critical factor in enhancing patient survival rates. The integration of intelligent computer-aided systems can significantly aid radiologists in this endeavour. The present study centres on the development of a machine learning-oriented methodology aimed at detecting lung cancer through the analysis of text-based medical data extracted from authentic medical reports. The present dataset encompasses a range of machine learning algorithms that have been utilised for binary classification purposes. These algorithms include Support Vector Machines (SVM), Logistic Regression, Gradient Boosting, and Catboost. The objective of this study is to determine the optimal algorithm for the detection of lung cancer with the highest degree of accuracy. By means of comprehensive experimentation, the SVM and Logistic Regression models yielded the highest accuracy rates of 95% and 94%, respectively. The findings of this study indicate the capability of machine learning algorithms in the prompt identification of lung cancer, thereby facilitating enhanced diagnosis and timely intervention.