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 Link: https://www.kaggle.com/clmentbisaillon/fake-and-real-news-dataset
Five classifiers are used in this project they are Naive Bayes, Random Forest, Decision Tree, SVM, Logistic Regression.
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:
-
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.
-
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.
-
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.
To use the system, follow these steps:
- Clone the repository.
- Create a virtual environment (venv or virtualenv) in the project directory.
- Activate the virtual environment.
- Install the required dependencies.
- Run
pip install -r requirements.txt
.
- Run
- 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
.
- If you are using Python 3, you can run
- Alternatively, you can run the
fake-news-detection.ipynb
notebook file in Jupyter Notebook/JupyterLab. - Enter your news article when prompted.
- The system will classify the news article as either fake or real.
Note: The system is provided in both .py
and .ipynb
file formats.
The system requires the following dependencies:
- pandas
- numpy
- matplotlib
- wordcloud
- seaborn
- nltk
- scikit-learn
This project is licensed under the MIT License. See the LICENSE file for more details.
For more details and tutorials, visit the website: DocsAllOver.
Follow us on:
and visit our website to know more about our tutorials and blogs.