Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sure! Here’s a template for your README.md file that includes an overview of your fake news detection project, instructions for setup, and usage details.


Fake News Detection Project

This project is a fully end-to-end fake news detection system. It takes news articles and classifies them as either true or fake using machine learning techniques.

Project Structure

  • data/: Contains raw and processed data files.
    • raw/:
      • True.csv: Contains true news articles.
      • False.csv: Contains fake news articles.
    • processed/:
      • combined.csv: Cleaned and combined dataset for training.
      • features.pkl: Extracted features from the text.
      • vectorizer.pkl: TF-IDF vectorizer used for feature extraction.
  • notebooks/: Jupyter notebooks for exploratory data analysis and model development.
  • src/: Contains source code for various components.
    • data_preprocessing.py: Scripts for loading, cleaning, and saving data.
    • feature_extraction.py: Scripts for feature extraction from text data.
    • model_training.py: Scripts for training and saving the model.
    • model_evaluation.py: Scripts for evaluating the model’s performance.
    • model_deployment.py: Scripts for deploying the model as a Flask API.
  • models/: Contains the saved trained model.
    • trained_model.pkl: Pickle file of the trained model.
  • requirements.txt: Python dependencies required for the project.
  • README.md: This file.
  • setup.py: Setup script for project configuration.

Installation

  1. Clone the repository:

    git clone https://github.com/Harshal12355/fake-news-detection.git
    cd fake-news-detection
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt

Usage

  1. Data Preprocessing: Run the following command to preprocess the data:

    python main.py
  2. Feature Extraction: After data preprocessing, extract features using:

    python src/feature_extraction.py
  3. Model Training: Train the model using:

    python src/model_training.py
  4. Model Evaluation: Evaluate the model's performance with:

    python src/model_evaluation.py
  5. Model Deployment: To deploy the model as a Flask API, run:

    python src/model_deployment.py

    The API will be available at http://127.0.0.1:5000/predict. You can send a POST request with a JSON payload like:

    {
      "text": "Sample news article text"
    }

Files and Folders

  • data/: Holds raw and processed data.
  • notebooks/: Contains notebooks for development.
  • src/: Contains source code.
  • models/: Stores the trained model.
  • requirements.txt: Lists Python package dependencies.

Contributing

Feel free to submit issues and pull requests. Please make sure to follow the coding style and include tests for any new features or fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions, please contact Harshal Shinoy Thachapully at harshalts@gmail.com.


Feel free to modify the sections according to your specific needs and project details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages