GithubHelp home page GithubHelp logo

icaroseara / product-categorization Goto Github PK

View Code? Open in Web Editor NEW
21.0 4.0 9.0 31.15 MB

Product Categorization with Machine Learning

License: MIT License

Makefile 19.48% Python 40.78% Jupyter Notebook 39.73%
flask scrapy autosklearn docker-compose docker machine-learning tfidf decision-tree

product-categorization's Introduction

Product Categorization

Product Categorization with Machine Learning

Project Organization

├── LICENSE
├── Makefile           <- Makefile with commands like `make data` or `make train`
├── README.md          <- The top-level README for developers using this project.
├── data
│   ├── external       <- Data from third party sources.
│   ├── interim        <- Intermediate data that has been transformed.
│   ├── processed      <- The final, canonical data sets for modeling.
│   └── raw            <- The original, immutable data dump.
│
├── docs               <- A default Sphinx project; see sphinx-doc.org for details
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
│                         the creator's initials, and a short `-` delimited description, e.g.
│                         `1.0-jqp-initial-data-exploration`.
│
├── references         <- Data dictionaries, manuals, and all other explanatory materials.
│
├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures        <- Generated graphics and figures to be used in reporting
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
│                         generated with `pip freeze > requirements.txt`
│
├── scraping
│   └── scraping
|       └── spiders    <- Crawlers scripts.
|
|
├── src                <- Source code for use in this project.
│   ├── __init__.py    <- Makes src a Python module
│   │
│   ├── data           <- Scripts to download or generate data
│   │   └── make_dataset.py
│   │
│   ├── features       <- Scripts to turn raw data into features for modeling
│   │   └── build_features.py
│   │
│   ├── models         <- Scripts to train models and then use trained models to make
│   │   │                 predictions
│   │   ├── predict_model.py
│   │   └── train_model.py
│   │
│   └── visualization  <- Scripts to create exploratory and results oriented visualizations
│       └── visualize.py
│
├── tests              <- Automated tests
└── tox.ini            <- tox file with settings for running tox; see tox.testrun.org

Prerequisite

Build docker image

docker-compose build

Running specs

docker-compose run web make test

Crawl public product's info from an e-commerce

The spider script collect product info from Petlove's site. After spider script has finished, a dataset.csv file will be generated to data/external directory.

  docker-compose run web make crawl_petlove

Make a prediction

Run docker container

docker-compose up -d

Make HTTP request using curl:

curl -d '{"name": "Ração Premier Pet Formula Cães Adultos Raças Pequenas","description": "Indicada para cães adultos de raça pequena, Ração Sabor Frango, Contem apenas ingredientes nobres e selecionados sob rigoroso controle de qualidade, Pelagem bonita e saudável, rico em acido graxo essenciais, Omega 3 e Omega 6, Ajuda no equilibrio intestinal, combinação de ingredientes de alta digestibilidade, fibras alimentares e prebioticos, Enriquecido com vitaminas e minerais que proporcional maior saúde e vitalidade"}' -H "Content-Type: application/json" -X POST http://localhost:5000/api/predict

Expected response:

{
  "prediction": {
    "category": "Cachorro, Rações, Ração Seca"
  }
}

Access Jupyter notebook

docker run -it -v $PWD:/opt/nb -p 8888:8888 felixleung/auto-sklearn \
/bin/bash -c "mkdir -p /opt/nb && jupyter notebook --notebook-dir=/opt/nb --ip='0.0.0.0' --port=8888 --no-browser --allow-root"

Datasets

product-categorization's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.