This project implements a Fake News Detection system that classifies news articles as either "Fake" or "True" using machine learning techniques. The model utilizes PassiveAggressiveClassifier to process text data and make predictions.
- Text Input: Users can input news text into a web form.
- Real-time Predictions: The system provides instant feedback on whether the news is classified as "Fake" or "True."
- Machine Learning Model: Uses a
PassiveAggressiveClassifier
trained on real and fake news datasets. - Text Preprocessing: The project employs
TfidfVectorizer
for feature extraction from the text data.
- Python: Backend processing and machine learning model.
- Flask: Web framework for serving the application.
- HTML/CSS: Frontend for user interaction.
- Scikit-learn: Library for machine learning.
-
Users submit a news article in the input form.
-
The application preprocesses the news using
TfidfVectorizer
. -
The pre-trained model predicts whether the news is fake or true.
-
The result is displayed on the webpage.
To run the Fake News Detection system locally, follow these steps:
- Clone the Repository:
git clone https://github.com/mohitkumhar/fake-news-detection.git
- Navigate to the Project Directory:
cd fake-news-detection
- Install the Required Dependencies:
Make sure you have Python and pip installed. Then, run:
pip install -r requirements.txt
- Run the Flask Application:
python app.py
- Open the Application:
Navigate to
http://localhost:5000
in your web browser to access the Fake News Detection interface.
The model was trained using a dataset containing true and fake news articles. The data was split into training and testing sets, and the PassiveAggressiveClassifier
was used for classification. The model achieved high accuracy and was saved for real-time predictions in the web app.
The dataset used consists of two parts:
- True.csv: Contains legitimate news articles.
- Fake.csv: Contains fake news articles.
- Integration of more advanced models like Logistic Regression, Random Forest, or Deep Learning techniques.
- Addition of features like credibility scoring and article source verification.
- Extension of the system to handle multilingual news detection.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the Repository: Click the "Fork" button at the top right corner of this page.
- Create a New Branch:
git checkout -b feature/YourFeatureName
- Make Your Changes: Add your improvements or features.
- Commit Your Changes:
git commit -m "Add some feature"
- Push to the Branch:
git push origin feature/YourFeatureName
- Create a Pull Request: Open a pull request on this repository and describe your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Scikit-learn for machine learning tools.
- Flask for web application framework.
- Dataset sources for providing real and fake news articles.