Giter Site home page Giter Site logo

transformer_text_classifiacation's Introduction

Fake News Classifier Using Transformers and Web App using FastAPI

This project aims to build a Transformer Based Learning model for classifying fake news articles. We use FastAPI to serve the model as a web application.

Table of Contents

Requirements

  • Python 3.x
  • pip
  • Virtual environment (optional but recommended)

Installation

Create a Virtual Environment

To isolate the dependencies, it is recommended to create a virtual environment. Run the following command to create a new virtual environment in a directory named .venv:

python -m venv .venv

Activate the Virtual Environment

Once the virtual environment is created, you need to activate it.

  • For macOS and Linux:

    source .venv/bin/activate
  • For Windows:

    .\.venv\Scripts\activate

Install Libraries

After activating the virtual environment, install the required libraries by running:

pip install -r requirements.txt

Training the Model

Once the libraries are installed, execute train_transformer_distillbert_classification.py to train your Deep Learning model. The model will be saved in Models Folder.

python train_transformer_distillbert_classification.py

Starting the FastAPI Application

After training the model, start the FastAPI application by running:

uvicorn main:app --reload

The FastAPI application will now be running and you can access it via http://127.0.0.1:8000/docs.


Note: The sample size is currently limited to 1000 due to computational constraints.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.