we build our model based on norm_train_reviewswhich contains the normalized training reviews that we have used in all our earlier analyses now that we have our classification pipeline readyyou can actually deploy the model by using pickle or joblib to save the classifier and feature objects similar to what we discussed in the "model deploymentsection in assuming our pipeline is in productionhow do we use it for new movie reviewslet' try to predict the sentiment for two new sample reviews (which were not used in training the modelin [ ]lr_pipeline predict(['the lord of the rings is an excellent movie'' hated the recent movie on tvit was so bad']out[ ]array(['positive''negative']dtype=objectour classification pipeline predicts the sentiment of both the reviews correctlythis is good startbut how do we interpret the model predictionsone way is to typically use the model prediction class probabilities as measure of confidence you can use the following code to get the prediction probabilities for our sample reviews in [ ]pd dataframe(lr_pipeline predict_proba(['the lord of the rings is an excellent movie'' hated the recent movie on tvit was so bad'])columns=classesout[ ]negative positive thus we can say that the first movie review has prediction confidence or probability of to have positive sentiment as compared to the second movie review with probability to have negative sentiment let' now kick it up notchinstead of playing around with toy exampleswe will now run the same analysis on actual reviews from the test_reviews dataset (we will use norm_test_reviewswhich has the normalized text reviewsbesides prediction probabilitieswe will be using the skater framework for easy interpretation of the model decisionssimilar to what we have done in under the section "model interpretationyou need to load the following dependencies from the skater package first we also define helper function which takes in document indexa corpusits response predictionsand an explainer object and helps us with the our model interpretation analysis from skater core local_interpretation lime lime_text import limetextexplainer explainer limetextexplainer(class_names=classeshelper function for model interpretation def interpret_classification_model_prediction(doc_indexnorm_corpuscorpusprediction_labelsexplainer_obj)display model prediction and actual sentiments print("test document index{index}\nactual sentiment{actual\npredicted sentiment{predicted}format(index=doc_indexactual=prediction_labels[doc_index]predicted=lr_pipeline predict([norm_corpus[doc_index]]))display actual review content print("\nreview:"corpus[doc_index]display prediction probabilities print("\nmodel prediction probabilities:"for probs in zip(classeslr_pipeline predict_proba([norm_corpus[doc_index]])[ ])print(probs