Fake News Detection System

5 min read
Rs. 20000 only

Share this project:

Machine Learning

The Fake News Detection System is a Python-based application designed to classify news articles as potentially fake or potentially genuine based on patterns learned from a labeled dataset. The system will use Natural Language Processing (NLP) and machine-learning techniques to preprocess news text, extract numerical features, and classify new articles. 

The project will use the Fake and Real News Dataset from Kaggle, which contains labeled fake and genuine news articles. Three machine-learning algorithms—Logistic Regression, Multinomial Naive Bayes, and Support Vector Machine (SVM)—will be trained and compared to identify the most suitable model. The system will evaluate model performance using accuracy, precision, recall, F1-score, and a confusion matrix. It will also examine classification errors and test whether simple text variations affect predictions. 

A simple user interface will allow users to enter a news article and view the classification result. The system will present its results as predictions based on learned textual patterns, not as definitive judgments about the truth of an article.

Dataset: Fake and Real News Dataset

The dataset contains news articles labeled as fake or genuine and is commonly provided in two CSV files: Fake.csv and True.csv. The files include fields such as article title, text, subject, and publication date. 

The project will use this dataset to train and evaluate machine-learning models for news classification. The dataset will be examined for missing values, duplicate records, available columns, and the distribution of fake and genuine news. The dataset source and download date will be recorded, and its labels will be treated as provided rather than independently verified judgments of factual accuracy.

 

Functional Requirements 

FR-01: Dataset Loading and Exploration The system shall load the dataset and display the number of records, column names, missing values, duplicate records, and distribution of fake and genuine news. 

FR-02: Data Preprocessing The system shall prepare the dataset by handling missing values, removing duplicate records, converting text to lowercase, removing unnecessary spaces and punctuation, and applying stopword removal where appropriate. 

FR-03: Feature Extraction The system shall convert news text into numerical features using TF-IDF (Term FrequencyInverse Document Frequency). The article title and text may be combined to improve classification.

 FR-04: Dataset Splitting The system shall divide the dataset into training and testing sets before fitting the TF-IDF vectorizer and classification models. A reproducible, stratified split shall be used where appropriate. Duplicate or repeated articles shall be checked to reduce the risk of similar records appearing in both sets. The test data shall remain separate during model training and selection. 

FR-05: Model Training and Comparison The system shall train and compare the following machine-learning algorithms: 

• Logistic Regression 

• Multinomial Naive Bayes 

• Support Vector Machine (SVM) 

All models shall be evaluated using the same data split and evaluation measures. The project shall present a comparison table and identify the best-performing model based on F1-score or another stated performance measure. 

FR-06: News Classification The system shall allow users to enter or paste a news article and classify it into one of two categories: 

• Potentially Fake 

• Potentially Genuine 

The system shall display the predicted category and clarify that the prediction does not independently verify the article's factual accuracy. 

FR-07: Model Evaluation The system shall evaluate model performance using: 

• Accuracy 

• Precision 

• Recall 

• F1-score 

• Confusion matrix 

The project shall also examine some incorrectly classified articles to understand the model's common errors.

 FR-08: Robustness and Error Analysis The system shall test whether simple text changes, such as capitalization, extra spaces, or minor punctuation changes, affect predictions. Where suitable dataset information is available, the project may also compare performance across different subjects or publication periods. 

FR-09: Data Visualization The system shall display graphs showing fake and genuine news distribution, model performance comparisons, and the confusion matrix. Additional graphs may be included to present classification errors. 

FR-10: User Interface and Error Handling The system shall provide a simple interface for entering news text and viewing the classification result. It shall display suitable messages for empty input, missing dataset files, or unavailable models.

 

    Tools & Technologies
  • Python,Pandas,NumPy,NLTK,Scikit
  • learn,Matplotlib,Seaborn,Jupyter Notebook

Share this project:

Faisal Mehmood

Faisal Mehmood Expert in CS619 Final Year Projects and software development.

View all projects