A method to generate compilable code from uncompilable code. The method includes receiving uncompilable code. The method further includes generating compilable code by one or more of (1) identifying and correcting syntax errors in the uncompilable code and (2) using an n-gram based token prediction model. The method further includes extracting features from the compilable code. The method further includes generating a machine learning model that recognizes patterns from extracted features in the compilable code.