HCL Commerce Version 9.1.15.0 or later

Tuning Natural Language Processor (NLP) expression providers

The Natural Language Processing (NLP) search expression providers enable HCL Commerce Search to understand and interpret your search terms more comprehensively.

By applying NLP techniques, expression providers generate a diverse range of metadata, including "priceFilter," "pos," "ner," "uom," "fraction," "dmm," and "color". This metadata is available under metaData > searchExecution > nlp node in the response JSON string.

POS (Part of Speech)

In the context of NLP, Part of Speech (POS) tagging is a technique that assigns grammatical categories to individual words within a sentence or phrase. This categorization helps the system categorize each word by role and function. In your search, POS tagging can boost specific words based on their grammatical category, leading to more accurate and relevant search results.

For more information, see Adding part-of-speech tags.

NER (Named Entity Recognition)

Named Entity Recognition (NER) is a key NLP process that identifies and classifies entities within text. In the context of product search, entities can include product categories, brands, or other specific terms that have special relevance. Boosting NER-recognized entities ensures that your search results are highly aligned with the products you're looking for.

GET http://hostname:port/search/resources/api/v2/products?storeId=1&searchTerm=mens party dress Albini 

Response Metadata: 

"metaData": {
    ...
    "searchExecution": [
        {
            "searchTerm": "men party dress Albini",
            "searchRule": {},
            "nlp": {
                "pos": "NOUN --> [parti~party] (boosted by 500.0)",
                "ner": "CATEGORY --> [men, dress~dresses] (boosted by 100.0) | BRAND_NAME --> [albini] (boosted by 50.0)"
            },
            "customFields": {}
        }
    ]
}
In this example, the NLP process recognizes "party" as a noun and gives it a significant boost in relevance. Additionally, NER identifies the category "men" and "dress," boosting their importance in the search results. This combination of POS and NER enhances the precision and accuracy of your search, ensuring that you find the right products.

For more information, see Adding custom nouns and classifications to NLP Name-Entity-Recognition (NER).

Note: The default boosting to Noun, Category and Branch is applied in Basic NLP only.

Color

The ColorMetchMaker NLP provider identifies and categorizes color-related information in your search terms.

GET http://hostname:port/search/resources/api/v2/products?storeId=1&searchTerm=red dress

Response Metadata: 

"metaData": {
    ...
    "searchExecution": [
        {
            "searchTerm": "red dress",
            "searchRule": {},
            "nlp": {
                "pos": "ADJECTIVE --> [red]",
                "ner": "CATEGORY --> [dress~dresses] (boosted by 100.0)",
                "color": "COLOR --> [red]"
            },
            "customFields": {}
        }
    ]
}
For more information, see Color Matchmaker.

UOM (Unit of Measurement)

The UOM NLP provider recognizes and categorizes measurement units within your search terms. This metadata helps ensure that your search results are tailored to the specific units you've defined. For example, when the search is for a 24” cabinet, the UOM metadata identifies "inch" as the unit of measurement, ensuring that the search results align with this measurement standard.

GET http://hostname:port/search/resources/api/v2/products?storeId=11&searchTerm=24” cabinet

Response Metadata: 
"metaData": {
    ...
    "searchExecution": [
        {
            "searchTerm": "24 inch cabinet",
            "searchRule": {},
            "nlp": {
                "ner": "CATEGORY --> [cabinet~cabinets] (boosted by 100.0)",
                "uom": "24 inch --> 24 inch"
            },
            "customFields": {}
        }
    ]
}

DMM (Dimension Match Maker)

The DMM NLP provider is responsible for recognizing and categorizing dimensions within your search terms. It breaks down the dimensions and presents them in an organized manner. For example, a search for 24 x 12 x 36 inch cabinet results in DMM metadata that presents the dimensions as 24 inch width | 12 inch length | 36 inch height, ensuring that you can easily identify products with the desired dimensions.

GET http://hostname:port/search/resources/api/v2/products?storeId=11&searchTerm=24x12x36 inch cabinet

Response Metadata: 

"metaData": {
    ...
    "searchExecution": [
        {
            "searchTerm": "24 x 12 x 36 inch cabinet",
            "searchRule": {},
            "nlp": {
                "ner": "CATEGORY --> [cabinet~cabinets] (boosted by 100.0)",
                "dmm": "24 x 12 x 36 inch --> 24 inch width | 12 inch length | 36 inch height"
            },
            "customFields": {}
        }
    ]
}

For more information, see Adding custom configuration to Dimension Matchmaker.

Fraction

The Fraction NLP provider focuses on identifying and processing fractions within your search terms. It recognizes fractions such as 4/3 and provides a numeric equivalent. For instance, a search for 5 x 4/3 ft cabinet results in Fraction metadata that represents 4/3 as 1.33, ensuring that the fraction is handled with precision.

GET http://hostname:port/search/resources/api/v2/products?storeId=11&searchTerm=5x4/3 ft cabinet

Response Metadata: 

"metaData": {
    ...
    "searchExecution": [
        {
            "searchTerm": "5 x 4/3 ft cabinet",
            "searchRule": {},
            "nlp": {
                "ner": "CATEGORY --> [cabinet~cabinets] (boosted by 100.0)",
                "fraction": "4/3 --> 1.33",
                "dmm": "5 x 1.33 ft --> 5 foot width | 1.33 foot length"
            },
            "customFields": {}
        }
    ]
}

Price filter

The Price Filter NLP provider is responsible for precisely identifying price filters within your search terms. It enables you to refine your search results based on price constraints, such as under $1000, between $100 and $500 or below $200 and generates metadata such as GTE:1000, LTE:2000. The Price Filter provider is designed to seamlessly integrate these filters into the final Elasticsearch Query.

GET http://hostname:port/search/resources/api/v2/products?storeId=1&searchTerm=5x4/3 ft cabinet

Response Metadata: 

"metaData": {
    ...
    "searchExecution": [
        {
            "searchTerm": "sofa between $1000 to $2000",
            "nlp": {
                "priceFilter": "between 1000 to 2000 --> [GTE:1000,LTE:2000]",
                "pos": "NOUN --> [sofa]"
            },
            "customFields": {}
        }
    ]
}