Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Fake News Tool (Bonus) | Fake News
Identifying Fake News

book
Fake News Tool (Bonus)

Congratulations on making it this far. You are playing a crucial role in the ongoing battle against fake news!

Since you have demonstrated such bravery, you now have the opportunity to test your own text and evaluate it using the models you have just trained. Simply run the script below and follow the instructions to input your text. Enjoy!

Please note that we will need to apply the same preprocessing steps to your text that we used on our dataset!

Aufgabe

Swipe to start coding

Simply run the provided script.

  • 0 means fake news;

  • 1 means true news.

Lösung

news = str(input())

# Creating a DataFrame with the text
df = pd.DataFrame([news], columns=['text'])

# Removing punctuation
df['text'] = df['text'].str.replace('[^\w\s]', '', regex=True)

#Vectorizing the text
text = vectorization.transform(df['text'])

# Making predictions
print('Logistic Regression prediction: ' + str(lr.predict(text)))
print('Decision tree prediction: ' + str(dt.predict(text)))

Mark tasks as Completed
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 7

Fragen Sie AI

expand
ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

some-alt