Giter Club home page Giter Club logo

fakenewsml's Introduction

9417_MachineLearning

Assignment - Fake news for the course COMP9417

Dataset

Fake News Challenge Dataset

Running / Installation

If you are running the code for the first time. Run the following commands in your python console. 1)

    -> import nltk
    -> nltk.download()
  1. Install contractions library which is used in the pre-processing part

     -> pip install contractions==0.0.18
    
  2. All the other libraries will come along with anaconda.

  3. If you want to experiment with the pre processing and feature extraction results you can delete the contents in the folders preprocessed_data and final_features.

  4. You need to run the main.py for the whole project to execute.

Implementation

  1. data_import.py - This file imports the data from the dataset and we use the competition_test files to test the data.

  2. train_validation_split.py - The train data that is imported from the csv files is split into 80 % train and 20 % validation to check the results before testing them on the test data.

  3. preprocess.py - We use different pre processing techniques like tokenize, stopwords, stem/lemmatize for the text data.

  4. feature_extraction.py - we mainly use three different concepts to extract features from the text. They are:

     1) Sentence Weighting 
     2) Ngrams (2 grams)
     3) TF-IDF Vectorizing
    
  5. models.py - we mainly use four different ML algorithms to find the class labels. They are:

     1) Random Forest Classifier
     2) Decision Tree Classifier
     3) Logistic Regression
     4) Naive Bayes
    
  6. metrics.py - We use different performance metrics like Competition Score, Accuracy, Precision, Recall, F1-score to evaluate our labels.

  7. score.py - This is the official scorer python file that is to be used, to evaluate the results.

Results and Comparisons

  1. Percentage of correctness for different stances for all the 5 algorithms we compare with:

correctness

  1. The accuracy - score chart for the dataset is:

accuracy-score

Report

For detailed information about the repository please find the pdf attached in report/report.pdf

fakenewsml's People

Contributors

con-mcleod avatar leonardlwq avatar shashankboosi 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.