Using Classifier Service for recommendation with Python

There is a demo classifier service on the demo server for category recommendation. Using the given demo service you can see an example python implementation.

import slamby_sdk
from slamby_sdk.rest import ApiException

client = slamby_sdk.ApiClient("https://europe.slamby.com/demo/")
client.set_default_header("Authorization", "Slamby s3cr3t")

request = {
    "Text": "Macbook Pro 13 inch with retina display",
    "Count": "2",
    "UseEmphasizing": False,
    "NeedTagInResult": True
}

try:
    result = slamby_sdk.ClassifierServiceApi(client).recommend_service(id="371c7e7a-8d28-4a47-82fe-8f1fdb0b228e",request=request)
    #print(result)
except ApiException as e:
    print(e)

Leave a Reply

Your email address will not be published. Required fields are marked *