Fake_News_Detector_Report
Fake_News_Detector_Report
1. Introduction
In recent years, the spread of fake news has become a significant problem in media and
communication. This project aims to build a Fake News Detector using machine learning
techniques. The model classifies news articles as either "Fake" or "Real" based on their textual
content. The solution leverages Natural Language Processing (NLP) techniques and machine
2. Objectives
- Libraries Used:
4. Methodology
Step 1: Data Collection
The dataset used for this project consists of news articles labeled as "Fake" or "Real." It contains
two columns:
The text data is preprocessed to remove noise and improve model performance:
The TfidfVectorizer is used to convert the text data into numerical features. This technique captures
A Logistic Regression model is trained on the preprocessed data to classify news articles. The
5. Results
- Accuracy: 93%
- Precision: 92%
- Recall: 94%
- F1-score: 93%
These results indicate that the model is effective in distinguishing between fake and real news
articles.
Preprocessing Function
```python
import re
def preprocess_text(text):
```
Prediction Function
```python
def predict_news(article):
processed_article = preprocess_text(article)
article_vectorized = vectorizer.transform([processed_article])
prediction = model.predict(article_vectorized)
```
7. Conclusion
This project successfully implemented a machine learning-based Fake News Detector. The model
8. References
- Dataset: Fake and Real News Dataset on Kaggle