Amazon Personalize- Domain Recommender Filter not Working

34 views Asked by At

I have created an E-commerce recommender and successfully getting recommendations from it for frequently-bought-together use case. I just want to make sure that no "delisted" items would be included in the recommendations generated. So I added the attribute "DELISTED" in the schema for items-metadata such that the schema looks as follows:

{
    "type": "record",
    "name": "Items",
    "namespace": "com.amazonaws.personalize.schema",
    "fields": [
        {
            "name": "ITEM_ID",
            "type": "string"
        },
        {
            "name": "PRICE",
            "type": "float"
        },
        {
            "name": "CATEGORY_L1",
            "type": "string",
            "categorical": true
        },
        {
            "name": "CATEGORY_L2",
            "type": "string",
            "categorical": true
        },
        {
            "name": "CATEGORY_L3",
            "type": "string",
            "categorical": true
        },
        {
            "name": "DESCRIPTION",
            "type": [
                "null",
                "string"
            ],
            "textual": true
        },
        {
            "name": "DELISTED",
            "type": [
                "null",
                "string"
            ],
            "categorical": true
        }
    ],
    "version": "1.0"
}

I re-uploaded the data and then created a filter named "exclude-delisted" with the following expression:

EXCLUDE ItemID WHERE Items.DELISTED IN ("True")

and I finally use it in my get_recommendations calls as follows:

    get_recommendations_response = personalize_runtime.get_recommendations(
        recommenderArn="recommenderArn",
        filterArn = "arn:filter/exclude-delisted",
        itemId=item_id,
        numResults=20
    )

yet when checking the results I still observe that the recommendations returned include some items where delisted value is True. Any clue what could be going wrong here?

0

There are 0 answers