Skip to content

Updated Model

Latest
Compare
Choose a tag to compare
@Sumit189 Sumit189 released this 17 Apr 03:31
· 10 commits to main since this release
ea13cbd

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)