DEV Community

Cover image for Fake News Detection using Machine Learning & NLP!
Urooj Fatima
Urooj Fatima

Posted on

Fake News Detection using Machine Learning & NLP!

Excited to share my latest project: Fake News Detection using Machine Learning & NLP!
In today's world of misinformation, I built an end-to-end system that automatically detects whether a news article is FAKE or REAL using Python, NLP, and Deep Learning.
What I built: ✅ Complete NLP pipeline with text cleaning & lemmatization ✅ TF-IDF vectorization with bigrams (5000 features) ✅ 6 Machine Learning models compared side by side ✅ Deep Neural Network with Dropout regularization ✅ Real-time user input prediction system ✅ EDA with Word Clouds & visualizations
Models Used: ▸ Logistic Regression ▸ Naive Bayes ▸ Random Forest ▸ Decision Tree ▸ Gradient Boosting ▸ Linear SVM ▸ Dense Neural Network (TensorFlow/Keras)
Key Findings: ▸ Fake news uses emotional, sensational & uppercase language ▸ Real news is formal, structured & factual ▸ Logistic Regression achieved excellent accuracy on TF-IDF features ▸ Neural Network with Early Stopping & Dropout prevented overfitting
️ Tech Stack: Python | Pandas | Scikit-learn | TensorFlow | Keras | NLTK | Matplotlib | Seaborn
This project taught me how powerful simple NLP techniques like TF-IDF can be when combined with the right models. Sometimes you don't need GPT — a well-tuned Logistic Regression can be just as effective!
Full code available on GitHub https://github.com/Urooj25/News_Detection_Model.git

Top comments (0)