Git Product home page Git Product logo

kairavipandya / fakenews Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 113.59 MB

This project aims to detect fake news using machine learning techniques. It utilizes a dataset containing news articles labeled as either real or fake.

Python 96.33% PowerShell 0.01% Shell 0.01% JavaScript 0.04% HTML 0.01% CSS 0.02% Jupyter Notebook 0.02% Lua 0.01% Cython 2.57% C 0.78% C++ 0.11% Meson 0.01% Fortran 0.08% Forth 0.01% Smarty 0.01% Roff 0.02%

fakenews's Introduction

Fake News Detection

This project aims to detect fake news using machine learning techniques. It utilizes a dataset containing news articles labeled as either real or fake.

Dataset

The dataset used for this project can be found here. It consists of news articles along with their corresponding labels indicating whether they are real (class 1) or fake (class 0).

Data Preparation

Before running the code, make sure to download the dataset and save it as News.csv in the project directory. The code automatically reads this CSV file and preprocesses the text data for analysis.

Setup

To run the project, follow these steps:

  1. Clone the repository:

    git clone <repository-url>
  2. Install the required dependencies:

    pip install pandas seaborn matplotlib tqdm nltk wordcloud scikit-learn
  3. Download NLTK resources:

    python -m nltk.downloader punkt stopwords
  4. Run the main script:

    python main.py

Usage

Upon running the script, it performs the following tasks:

  1. Loads the dataset and preprocesses the text data.
  2. Generates word clouds for real and fake news articles.
  3. Displays a bar chart of the top words frequency.
  4. Splits the data into training and testing sets.
  5. Trains logistic regression and decision tree classifiers.
  6. Evaluates the performance of the classifiers using accuracy scores and confusion matrices.

Authors

fakenews's People

Contributors

kairavipandya avatar

Watchers

 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.