Giter Site home page Giter Site logo

smridhvarma / fake-news-detection Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 17.18 MB

This repository houses a Streamlit web application for fake news detection. The app allows users to input a news article and predicts whether it is likely fake or real based on its content. It provides options to select different vectorizers (TF-IDF or Bag of Words) and classifiers (Linear SVM or Naive Bayes) to customize the prediction model.

Home Page: https://fnddeploy.azurewebsites.net/

Jupyter Notebook 96.23% Python 3.29% Dockerfile 0.47%
bagofwords fakenewsdetection linearsvc naive-bayes-classifier scikit-learn streamlit-webapp tfidf-vectorizer live

fake-news-detection's Introduction

Fake News Detection Webapp

Description

This Streamlit app is designed to detect whether a news article is likely fake or real based on its content. It allows users to input a news article, select a vectorizer and classifier, and then predicts the authenticity of the article.

Modules

Module 1: Import necessary packages

  • streamlit: For creating the web application.
  • numpy: For numerical computations.
  • pandas: For data manipulation and analysis.
  • sklearn: For machine learning functionalities.
  • warnings: For ignoring warnings.
  • streamlit_lottie: For displaying Lottie animations.

Module 2: Load the dataset

  • Loads the dataset containing fake and real news articles from a CSV file.
  • Converts the labels to binary format (0 for real, 1 for fake).

Module 3: Select Vectorizer and Classifier

  • Allows users to select a vectorizer (TF-IDF or Bag of Words) and a classifier (Linear SVM or Naive Bayes) via the sidebar.

Module 4: Train the model

  • Trains the selected classifier model using the chosen vectorizer and the loaded dataset.
  • Caches the trained model for faster access.

Module 5: Streamlit app

  • Sets page configuration including title, icon, and layout.
  • Displays the title and a Lottie animation.
  • Hides the Streamlit style for a cleaner interface.
  • Provides a text area for users to input news articles.
  • Upon clicking the "Check" button, predicts the authenticity of the input news article using the trained model and displays the result.

Usage

  • Run the Streamlit app using the command: streamlit run main.py --client.showErrorDetails=false to remove cache error messages on the Streamlit interface.
  • Input a news article into the text area.
  • Select a vectorizer and classifier from the sidebar.
  • Click the "Check" button to see the prediction result.
image

fake-news-detection's People

Contributors

smridhvarma 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.