Summary
In this chapter, we covered a very important topic on creating a multi-step inference pipeline using MLflow's custom Python model approach, namely mlflow.pyfunc.PythonModel
.
We discussed four patterns of inference workflow in production where usually a single trained model is not enough to complete the business application requirements. It is highly likely some preprocessing and postprocessing logic is not seen during the model training and development stage. That's why MLflow's pyfunc
approach is an elegant approach to implementing a custom MLflow model that can wrap a trained DL model with additional preprocessing and postprocessing logic.
We successfully implemented an inference pipeline model that wraps our DL sentiment classifier with language detection using Google's Compact Language Detector, caching, and additional model metadata in addition to the prediction label. We went one step further to incorporate the inference pipeline model creation...