Skip to content

acheshkov/text-classification-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Classification Tutorial

This repository shows how to get a baseline model for test classification task. We experimented with following models:

  • Multinomial Naive Bayes
  • Bernoulli Naive Bayes
  • Logistic Regression
  • SVM

Jupyter Notebook

Here you can find a notebook with code to seek for a baseline model.

Docker

This repository also provides an example how to wrap your model in simple web API interface. For this purpose we use Flask and docker container.

You can either use public image acheshkov/text-clf from docker hub or build your own. To build own put model file model.joblib to model folder and execute:

$ docker build -t IMAGE_TAG_NAME .

To run container specify port you need:

$ docker run -d -p PORT:80 IMAGE_TAG_NAME

or use existing image:

$ docker run -d -p PORT:80 acheshkov/text-clf

Since Web API deployed you can call it

$ curl -d '{"text": "any text to classify"}'  https://YOUR_BACKEND:PORT/classify