Skincare Product Recommendation API

An AI-powered skincare product recommendation system that predicts the best skin type match for skincare products based on their descriptions.

Features

  • Product Analysis: Analyzes skincare product descriptions using TF-IDF vectorization
  • Skin Type Classification: Classifies products into 7 skin type categories
  • Confidence Scores: Provides probability distributions across all skin types
  • Batch Processing: Support for multiple product predictions

Supported Skin Types

  • Acne-Prone Skin
  • Anti-Aging
  • Brightening
  • Dry Skin
  • Normal
  • Oily
  • Oily Skin

API Endpoints

GET /

Welcome endpoint with API information

GET /health

Health check endpoint showing model status and available skin types

POST /predict

Predict skin type for a single product

Request Body:

{
  "product_description": "Hydrating facial cleanser with ceramides and hyaluronic acid for all skin types"
}

Response:

{
  "product_description": "Hydrating facial cleanser...",
  "recommended_skin_type": "Dry Skin",
  "confidence": 0.85,
  "all_probabilities": {
    "Acne-Prone Skin": 0.05,
    "Anti-Aging": 0.03,
    "Brightening": 0.02,
    "Dry Skin": 0.85,
    "Normal": 0.03,
    "Oily": 0.01,
    "Oily Skin": 0.01
  }
}

POST /batch-predict

Predict skin types for multiple products at once

How It Works

  1. Text Preprocessing: Product descriptions are processed using TF-IDF vectorization
  2. Classification: A Logistic Regression model classifies the product
  3. Results: Returns the predicted skin type with confidence scores

Technology Stack

  • FastAPI: Modern web framework
  • scikit-learn: Machine learning library
  • Docker: Containerization
  • Uvicorn: ASGI server

Usage Example

import requests

url = "https://your-space-url/predict"
data = {
    "product_description": "Lightweight gel moisturizer with hyaluronic acid"
}

response = requests.post(url, json=data)
print(response.json())

Model Information

  • Algorithm: Logistic Regression
  • Features: TF-IDF vectorized product descriptions
  • Classes: 7 skin type categories
  • Framework: scikit-learn 1.7.2
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support