This is a web-based application that detects whether a given news article is real or fake. The application uses machine learning and natural language processing (NLP) techniques to classify the news as "Fake" or "Genuine".
Fake news is a serious problem in today’s digital age, leading to the spread of misinformation. This project aims to help mitigate this problem by using a machine learning model to identify fake news articles based on their content.
- User-friendly Interface: Enter news content and receive an instant result.
- Real-time Prediction: Utilizes a trained model to classify news as either Fake or Genuine.
- Input Cleaning: Text preprocessing to remove URLs, HTML tags, digits, and punctuation for accurate predictions.
- Backend: Flask (Python)
- Machine Learning: scikit-learn, Pandas, TfidfVectorizer, Decision Tree Classifier Model
- Frontend: HTML, CSS, Jinja2
- Data Storage: Vectorizer and Model saved using Pickle
- Python 3.7 or later
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/your-username/fake-news-detection.git cd fake-news-detection -
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
.\venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install required packages:
pip install -r requirements.txt
-
Run the Flask app:
python app.py
-
Open your web browser and go to
http://127.0.0.1:5000/.
- Open the web application.
- Enter the news article text into the input box.
- Click the "Check Now" button.
- The application will return the result as either "It is a fake news" or "It is a genuine news".
- Model Improvements: Implement additional machine learning models to improve accuracy.
- More Preprocessing: Enhance text preprocessing techniques.
- Data Updates: Keep the model updated with new datasets to stay current with evolving news trends.
- Thanks to the open-source community for providing valuable datasets and tools.
- scikit-learn, Flask, and Jinja2 are used extensively in this project.
