Loading the model
import joblib
model = joblib.load("trained_model/model-V2.joblib")
vectorizer = joblib.load("trained_model/vectorizer-V2.joblib")
Making Predictions
label = ["Non Abusive", "Abusive"]
test_str= "Good Day"
X = vectorizer.transform([user_input])
y = model.predict(X)
proba = model.predict_proba(X)
y_label = label[y[0]]
y_probability = np.max(proba)*100
print("Tone: {}, Probability: {}".format(y, y_probability)