Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele 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!

Tehtävä

Swipe to start coding

Simply run the provided script.

  • 0 means fake news;

  • 1 means true news.

Ratkaisu

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
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 7

Kysy tekoälyä

expand
ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

some-alt