Skip to content

oscar-defelice/txt-clf-api.github.io

Repository files navigation

Web API for text classifier model

Introduction

This repository contains the code useful to publish a web API to input and predict the class of a text. The input text will be fed to a pretrained model, deployed in tensorflowjs.

Components

  • Backend:
    • v1. Flask (I know that TFJS supports node now but for the sake of suitable preprocessing it's in python).
    • v2. Python
  • Preprocessing: conversion of text in sequences.
  • Frontend: tensorflowjs (I have a script in head from cdn, made for python developers in order not to download a module).

Repository structure

Model

Model deployed in a tensorflowjs format.

Usage

Simply open the webpage. Input a text and press predict.

Enjoy!

p.s. This repository served as the base for this Medium post. I refer to that for a detailed explanation of both model and website structure.