whatsapp

whatsApp

Have any Questions? Enquiry here!
☎ +91-9972364704 LOGIN BLOG
× Home Careers Contact
Back
Fake News Detection Using Python
Fake News Detection Using Python

Fake News Detection Using Python

Fake news do not require any introduction. It is very much easy to spread all the fake information in today’s all-connected world across the internet. Fake news is sometimes transmitted through the internet by some unauthorised sources, which creates issues for the targeted person and it makes them panic and leads to even violence. To combat the spread of fake news, it’s critical to determine the information’s legitimacy, which this Data Science project can help with. To do so, Python can be used, and a model is created using TfidfVectorizer. PassiveAggressiveClassifier can be implemented to distinguish between true and fake news. Pandas, NumPy, and sci-kit-learn are some Python packages suitable for this project, and we can utilize News.csv for the dataset.

Fake News means incorporating information that leads people to the wrong paths. It can have real-world adverse effects that aim to intentionally deceive, gain attention, manipulate public opinion, or damage reputation. It is necessary to detect fake news mainly for media outlets to have the ability to attract viewers to their website to generate online advertising revenue.

 

  1. Importing Libraries and dataset
  2. Preprocessing Dataset
  3. Generating Word Embeddings
  4. Model Architecture
  5. Model Evaluation and Prediction

The proliferation of fake news is a significant challenge for modern democratic societies. Inaccurate information can affect the health and well-being of people, especially during the challenging times of the COVID-19 pandemic. Furthermore, disinformation erodes public trust in democratic institutions, by preventing citizens from making rational decisions based on verifiable facts. A disturbing study has shown that fake news reach more people and spread faster than actual facts, especially on social media. MIT researchers have discovered that fake news are 70% more likely to be shared on platforms like Twitter and Facebook¹.

Fake news campaigns are a form of modern information warfare, used by states and other entities to undermine the power and legitimacy of their opponents. According to EU authorities spreading falsehoods about numerous topics, including the COVID-19 pandemic has been set up to deal with that problem, by monitoring and debunking fake news about EU member states.

Fact-checkers are individuals that verify the factual correctness of published news. Those professionals debunk fake news by identifying their false claims. Research has shown that traditional fact-checking can be augmented by machine learning and natural language processing (NLP) algorithms². In this article, I am going to explain how I developed a web application that detects fake news written in my native language (Greek), by using the Python programming language.

           

The Greek Fake News Dataset

The success of every machine learning project depends on having a proper and reliable dataset. There are numerous publicly available fake news datasets, such as LIAR³ and FakeNewsNet⁴, but unfortunately most of them are comprised of english articles exclusively. As I couldn’t find any datasets including articles in Greek, I decided to create my own is comprised of real and fake news written in the greek language, and can be used to train text classification models, as well as other NLP tasks.

The dataset was created based on the following methodology. First of all, real news items were collected from a number of reputable greek newspapers and websites. I added news from a variety of topics, mostly focusing on politics, the economy, the COVID-19 pandemic and world news. To identify fake news articles, I consulted a greek fact-checking website that has been certified by the (IFCN). A sample of news items verified to be false were also added to the dataset. After that process was completed, the resulting dataset was used to train the text classification model of the Greek Fake News Detector application.

The spaCy Python Library

There are numerous advanced Python libraries that can be used for natural language processing tasks. One of the most popular is a NLP library that comes with pre-trained models, as well as support for tokenization and training for more than 60 languages. spaCy includes components for named entity recognition (NER), part-of-speech tagging, sentence segmentation, text classification, lemmatization, morphological analysis, and others. Furthermore, spaCy is robust and production-ready software that can be used in real-world products. This library was used to create the text classification model of the Greek Fake News Detector application.

The Streamlit Framework

 is a Python framework that lets you build web apps for data science projects very quickly. You can easily create a user interface with various widgets, in a few lines of code. Furthermore, Streamlit is a great tool for deploying machine learning models to the web, and adding great visualizations of your data. Streamlit also has a powerful caching mechanism, that optimizes the performance of your app. Furthermore, is a service provided freely by the library creators, that lets you easily deploy and share your app with others. A detailed introduction to Streamlit is available .

Note : Find the best solution for electronics components and technical projects  ideas

 

keep in touch with our social media links as mentioned below

Mifratech websites : https://www.mifratech.com/public/

Mifratech facebook : https://www.facebook.com/mifratech.lab

mifratech instagram : https://www.instagram.com/mifratech/

mifratech twitter account : https://twitter.com/mifratech

Contact for more information : [email protected] / 080-73744810 / 9972364704

 

Popular Coures