Skip to content

docsallover/fake-news-detection

Repository files navigation

Fake News Detection using Machine Learning

This project is a fake news detection system that uses machine learning algorithms to classify news articles as either fake or real. The system uses two datasets from Kaggle, namely "Fake" and "True", to train the model. The two datasets contain news articles labeled as either fake or real.

Dataset

Dataset Link: https://www.kaggle.com/clmentbisaillon/fake-and-real-news-dataset

Classifiers

Five classifiers are used in this project they are Naive Bayes, Random Forest, Decision Tree, SVM, Logistic Regression.

Overview

Fake news detection is a type of text classification problem. The system uses machine learning algorithms to classify news articles as either fake or real. The system consists of three main components:

  1. Data preprocessing: This step involves cleaning and preprocessing the datasets to prepare them for analysis. The datasets contain information about news articles such as their text, title, and author.

  2. Model training: This step involves training machine learning models to classify news articles as either fake or real. The models are trained using the preprocessed datasets.

  3. Model evaluation: This step involves evaluating the performance of the trained models. The performance of the models is evaluated using metrics such as accuracy, precision, recall, and F1 score.

How to Use

To use the system, follow these steps:

  1. Clone the repository.
  2. Create a virtual environment (venv or virtualenv) in the project directory.
  3. Activate the virtual environment.
  4. Install the required dependencies.
    • Run pip install -r requirements.txt.
  5. Run the fake-news-detection.py file to execute the system.
    • If you are using Python 3, you can run python fake-news-detection.py.
  6. Alternatively, you can run the fake-news-detection.ipynb notebook file in Jupyter Notebook/JupyterLab.
  7. Enter your news article when prompted.
  8. The system will classify the news article as either fake or real.

Note: The system is provided in both .py and .ipynb file formats.

Dependencies

The system requires the following dependencies:

  • pandas
  • numpy
  • matplotlib
  • wordcloud
  • seaborn
  • nltk
  • scikit-learn

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Visit and Follow

For more details and tutorials, visit the website: DocsAllOver.

Follow us on:

and visit our website to know more about our tutorials and blogs.