Giter VIP home page Giter VIP logo

fake_news_detection's Introduction

Fake News Detection Using Python

giphy

The exponential growth of digital media and the ever-increasing volume of news articles published daily have given rise to the need for efficient and accurate classification of these articles. In recent years, the spread of fake news has become a pressing issue, impacting the credibility of media sources and the integrity of public discourse. Manual classification is not only time-consuming and resource-intensive but also prone to errors and inconsistencies. As a result, there is a demand for an automated approach to classify news articles into predefined categories based on their content, which can improve content organization, enhance user experience, facilitate more targeted advertising, and detect and mitigate the spread of fake news.

This project aims to develop a Naive Bayes text classification model that can accurately predict the category of a news article using only its content, with a specific focus on identifying and flagging fake news. The model must be robust and capable of handling a diverse range of topics, maintaining high performance across various categories, and adapting to potential changes in the distribution of articles over time.

Dataset

The dataset comprises news articles from various categories, including business, entertainment, politics, sport, tech, and fake/real news.

Methodology

The project methodology includes data exploration, data cleaning, data visualization, feature engineering, model training, hyperparameter tuning, and performance evaluation. The Python code for the Naive Bayes text classification model can be found in the src folder. The code includes a pipeline that integrates the TfidfVectorizer and Bernoulli Naive Bayes classifier, allowing for efficient and accurate prediction of the category of a news article based on its content.

Evaluation Metrics

To evaluate the effectiveness of the model, we employed various metrics, including accuracy, precision, recall, and F1-score, to provide a comprehensive evaluation of its performance across all categories.

Installation

To run the code, please ensure that you have Python 3 installed on your machine, as well as the required libraries listed in the requirements.txt file.

Usage

To run the code, simply run the main.py file.

Conclusion

This project offers valuable insights into the development and evaluation of a Naive Bayes text classification model for news article categorization and fake news detection. The code and dataset provided in this repository can be used by news organizations, researchers, and developers to improve their content management processes and mitigate the spread of fake news.

fake_news_detection's People

Contributors

palak807 avatar parthdacoder avatar

Stargazers

 avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.