Hi,
I’m new to this domain, so I need someone to explain me this code, because I dont understand very well the part with “0” and “1” from prediction[0] and prob[0][1].
import pickle
var = input("Please enter the news that you want to verify: ")
#print(“You entered:” + str(var))
def fakenews(var):
load_model = pickle.load(open(‘model.sav’, “rb”))
prediction = load_model.predict([var])
prob = load_model.predict_proba([var])
return (print("The given statement is: ", prediction[0]),
print("The truth probability score is: ", prob[0][1]))
if name == ‘main’:
fakenews(var)
Thank you!
2 posts - 2 participants