Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,11 @@ random_forest = joblib.load('./random_forest.pkl')
|
|
10 |
|
11 |
def classify(text,choice):
|
12 |
corpus=[text]
|
13 |
-
features = vectorizer.transform(corpus).toarray()
|
14 |
if(choice == 1):
|
|
|
15 |
prediction = nb_classifier.predict(features)
|
16 |
elif(choice == 2):
|
|
|
17 |
prediction = random_forest.predict(features)
|
18 |
if(prediction == 1):
|
19 |
return "Fake News"
|
|
|
10 |
|
11 |
def classify(text,choice):
|
12 |
corpus=[text]
|
|
|
13 |
if(choice == 1):
|
14 |
+
features = vectorizer.transform(corpus).toarray()
|
15 |
prediction = nb_classifier.predict(features)
|
16 |
elif(choice == 2):
|
17 |
+
features = tfidf_vectorizer.transform(corpus).toarray()
|
18 |
prediction = random_forest.predict(features)
|
19 |
if(prediction == 1):
|
20 |
return "Fake News"
|