Dynamic Categorization Single Instance

Dynamic categorization best fits product information such as title and description to a product taxonomy tree or categories list. The baseline dynamic categorization endpoint does not need to be tuned for your specific categories as it's learned a relationship across different taxonomy trees.

A fine-tuned dynamic categorization model is a newly trained model that focuses on fitting product data to a specific taxonomy tree or categories list. Once the model has been fine-tuned on your specific tree it cannot change. The model has been "steered" to your specific use case and products. The steering leads to a much higher accuracy for your specific products and catalog information.

Single instance API runs a single product action through the Pumice.ai endpoints.

API information for single instance dynamic categorization endpoint:

import requests
import json
url = 'https://app.pumice.ai/api/categorize-product'
payload = {
"data":{
"title": "Pink shoes",
"description": "Pink"
},
"run_type":"dynamic",
"model_id":"m",
"tree_id":"19"
}
headers = {'KEY': '<YOUR_API_KEY>','Content-Type': 'application/json'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Route

https://app.pumice.ai/api/categorize-product

Return

This endpoint returns a json payload. Please note the containing brackets are a part of the output.

{
"product_categories": {
"categories": "Clothing, Shoes & Jewelry > Costumes & Accessories > Women > Costumes & Cosplay Apparel > Tops & Corsets"
},
"credits": {
"bought": 1340,
"spent": 71,
"left": 1269
}
}

Required Headers

API key and content type are required.

{'KEY': '<YOUR_API_KEY>','Content-Type': 'application/json'}

data

Data filed contains a payload of product data for categorization. Currently the only required fields for dynamic categorization are "title" and "description". This field is required. If you are using a fine-tuned instance that does not use title and description please leave the unused field empty.

Type: dict
Default: None

Example Data Payload:

"data":{
"title": "Pink shoes",
"description": "Pink"
}

run_type

Choose which categorization endpoint you want to use. Options are static and dynamic.

Type: string
Default: None

tree_id

Id from an uploaded taxonomy tree. This id comes from the upload tree endpoint: https://app.pumice.ai/api/upload-tree. This allows you to upload and store your trees for processes like this one.

Type: int
Default: None

model_id

Id used to access your fine-tuned model or any fine-tuned models available across plans. If you are a fine-tuned or enterprise user and do not know your model_id please reach out to support. Model_id is case sensitive.

Type: string
Default: None