Giter Club home page Giter Club logo

rishabh-karmakar / detection-of-real-or-fake-news Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 12.02 MB

Detect Real or Fake News. To build a model to accurately classify a piece of news as REAL or FAKE. Using sklearn, build a TfidfVectorizer on the provided dataset. Then, initialize a PassiveAggressive Classifier and fit the model. In the end, the accuracy score and the confusion matrix tell us how well our model fares.

Jupyter Notebook 98.63% Python 1.37%
nlp text text-classification tfidf-vectorizer tfidf tfidf-text-analysis passive-aggressive passive-aggressive-classifier sklearn sklearn-vectorizer

detection-of-real-or-fake-news's Introduction

Detection-of-Real-or-Fake-News

PROBLEM STATEMENT

To build a model to accurately classify a piece of news as REAL or FAKE.

Using sklearn, build a TfidfVectorizer on the provided dataset. Then, initialize a PassiveAggressive Classifier and fit the model. In the end, the accuracy score and the confusion matrix tell us how well our model fares.

Description of all files:

  • news.zip: Unzip the Dataset to get news.csv
  • news.csv: Dataset having fake and real news
  • Real_or_Fake_News.ipynb: Jupyter Notebook containing all explanation and my workdoings
  • train.py: Simply run this file to automatically train the model and generate vocabulary and model.pkl file to be saved for further
    Could be run only once
    Takes a command line argument taking the file name
    Usage
python train.py news.csv
  • predict.py: Run this file as much as you want. Uses the saved models to run, hence is much faster to execute.
    P.S The larger the text, the better the chance of accurate prediction
python predict.py

Annotation of cmd

Disclamer: I donot guarrantee in case some real life sensitive words comes off as fake. It is solely trained on the dataset. No feelings are meant to be hurt.

detection-of-real-or-fake-news's People

Contributors

rishabh-karmakar avatar

Stargazers

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