Skip to content

Update NLP Configurations

To update the NLP thresholds and configurations.

Method POST
Endpoint https://{{host}}/api/public/bot/{{BotID}}/configurations?language={{languageCode}}&groupName={{groupName}}
Content Type application/json
Authorization auth: {{JWT}}

See How to generate the JWT Token.

API Scope
  • Bot Builder: NLP Configurations
  • Admin Console: Test > NLP Configurations & Train

Query Parameters

PARAMETER DESCRIPTION MANDATE
host The environment URL. For example, https://bots.kore.ai Required
BotID The Bot ID or Stream ID that can be accessed under General Settings on the Bot Builder. Required
languageCode The Bot language in which the configurations need to be updated. Required
groupName The GroupName can be used to update the ML parameters of a specific group. To update Bot level Intent Model Configurations, groupName should be set to “Bot Level Intent Model“. Required

for Multiple ML Model

Sample Request

curl --location -g --request POST 'https://{{host}}/api/public/bot/{{bot-id}}/configurations?language={{languageCode}}' \
  --header 'auth: YOUR_JWT_ACCESS_TOKEN' \
  --header 'content-type: application/json' \
  --data-raw '{
    "advancedNLPSettings": [
        {
            "configurationKeyName": "NoneIntent",
            "configurationValue": true,
            "nlpEngine": "ML"
        }
    ],
    "configurations": [
        {
            "mode": "ml",
            "exactMatchThreshold": 85,
            "useDependencyParser": true,
            "minThreshold": 0.2
        },
        {
            "mode": "faq",
            "useBotSynonyms": true,
            "searchInAnswer": {
                "enabled": true,
                "notifyUser": false,
                "responseType": "relevantWithReadMore",
                "customReadMoreURL": "aa",
                "useCustomReadMoreURL": true
            }
        }
    ],
    "mlParams": {
        "intentParams": {
            "features": "skip_gram",
            "skip_gram": {
                "seqLength": 3,
                "maxSkipDistance": 2
            }
        }
    },
    "nlSettings": {
        "enableAutoUtteranceAddition": false,
        "enableNegativePatterns": true
    }
}'

Body Parameters

The parameters depend on the threshold configuration that needs to be updated. The comprehensive list of the parameters for the various threshold configurations is given below:

Update Settings

Machine Learning Engine

This section refers to the configurations related to the Machine Learning engine. For details on the configurations, please click here.

{
    "configurations": [
        {
            "mode": "ml",               // Machine Learning Engine
            "exactMatchThreshold": 90,  // ML Definitive Score - value in range [80-100]
            "minThreshold": 0.4        // ML threshold - value in range [0-1]
        }
    ],
    "mlParams": {
        "intentParams": {
            "useSynonyms": true,       // Bot Synonyms
            "useStopwords": true,      // Stopwords
            "usePlaceholders": true,   // Entity Placeholders
            "features": "skip_gram",       // Feature Extraction - value in range [skip_gram, n_gram]
            "skip_gram": {             // features should be 'skip_gram'
                "seqLength": 2,        // Sequence Length - value in range [2-4]
                "maxSkipDistance": 1   // Maximum Skip Distance - value in range [1-3]
              }               // ngram Sequence Length - value in range [1-4]
                                       // features should be 'n_gram'
        },
        "nerParams": {
            "type": "corenlp"          // NER Model
                                       // could be "corenlp" for  Conditional Random Field
                                       //       or "spacy" -  Deep Neural Network
         }
    }
}