NLP 임곗값 및 설정을 업데이트합니다
이 API를 사용하려면 앱은 NLP 설정의 봇 빌더 API 범위가 필요합니다. 또는 테스트 및 학습에서 NLP 설정의 관리자 API 범위가 필요합니다.
POST https://{{host}}/api/public/bot/{{BotID}}/configurations?language={{languageCode}}&groupName={{groupName}}
NLP 임곗값 및 설정을 업데이트합니다
이 API를 사용하려면 앱은 NLP 설정의 봇 빌더 API 범위가 필요합니다. 또는 테스트 및 학습에서 NLP 설정의 관리자 API 범위가 필요합니다.
POST https://{{host}}/api/public/bot/{{BotID}}/configurations?language={{languageCode}}&groupName={{groupName}}
매개 변수 | 필수/선택 사항 | 설명 |
---|---|---|
host | 필수 | 환경 URL(예: https://bots.kore.ai) |
BotID | 필수 | 봇 ID 또는 스트림 ID. 봇의 일반 설정 페이지에서 이를 액세스할 수 있습니다. |
languageCode | 필수 | 이러한 설정을 업데이트해야 하는 봇 언어입니다. |
groupName | 다중 ML 모델에 필요 | GroupName을 사용하여 특정 그룹의 ML 매개 변수를 업데이트할 수 있습니다. 봇 수준 의도 모델 설정 groupName을 업데이트하려면 그룹 이름을 "봇 수준 의도 모델"로 설정해야 합니다. |
매개 변수는 업데이트해야 하는 임곗값 설정에 따라 달라집니다. 다음은 다양한 임곗값 설정에 대한 전체 매개 변수 목록입니다.
이 섹션에서는 머신 러닝 엔진과 관련된 설정을 다룹니다. 설정에 대한 자세한 내용은 여기를 참조하세요.
{ "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": "n_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": 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 } } }
이 섹션에서는 엔진의 기본 의미와 관련된 설정을 다룹니다. 설정에 대한 자세한 내용은 여기를 참조하세요.
{ "configurations": [ { "mode": "cs", // Fundamental Meaning Engine "labelMatch": true // Intent Detection using Task Name Words "isFMThreshold": true, //FM Threshold "fmThreshold": 15 //FM Threshold value } ] }
이 섹션에서는 지식 그래프 엔진과 관련된 설정을 다룹니다. 설정에 대한 자세한 내용은 여기를 참조하세요.
{ "configurations": [ THRESHOLDS & CONFIGURATIONS { "mode": "faq", "autoSpellCorrectEnabled": true, // Auto Correction "useBotSynonyms": true, // Bot Synonyms "enPatternLemma": false, // Lemmatization using Parts of Speech "pathCoverage": 50, // Path Coverage - value in range [0-100] "exactMatchThreshold": 95, // Minimum and Definitive Level for Knowledge Tasks // value in range [0-100] // should be more than minThreshold & maxThreshold "maxThreshold": 80, // Probable range for Knowledge Task // value in range [0-100] // should be between minThreshold & exactMatchThreshold "minThreshold": 60, // Low confidence range for Knowledge Task // value in range [0-100] // should be less than maxThreshold & exactMatchThreshold "suggestionsCount": 3, // KG suggestionsCount | [0-5] "taskMatchTolerance": 35, // Proximity of Suggested Matches | [0-50] "longResponses": { "readMore": true, // Manage Long Responses "useCustomReadMoreURL": true, // readMore should be true "customReadMoreURL": "www.siteurl.com" // readMore link; readMore should be true }, "searchInAnswer": { "enabled": true, // Search in Answer "notifyUser": true, // Inform end user that it is a probable answer "responseType": "relevantWithReadMore", // can be "complete" - Show complete response, // or "relevant" - Show only the relevant paragraph, // or "relevantWithReadMore" - Show only the relevant paragraph with “read more” link ] "customReadMoreURL": "www.siteurl.com", // “read more” link "useCustomReadMoreURL": true // enabled should be true } "qualifyContextualPaths": false, // Qualify Contextual Paths } ] }
이 섹션에서는 순위 및 해결 엔진과 관련된 설정을 다룹니다. 설정에 대한 자세한 내용은 여기를 참조하세요.
{ "configurations": { "mode": "rr", // Ranking and Resolver Engine "taskMatchTolerance": 2, // Proximity of Probable Matches - value in range [0-20] "useDependencyParser": true, // Dependency Parsing Model "minMatchVal": 0.4, // Minimum Match Score - value in range [0-1] // useDependencyParser should be true "rankingParameters": "" // Advanced Configurations // useDependencyParser should be true "intentRescoring": false, // Rescoring of Intents "isPreferDefinitiveMatch": true // Prefer Definitive Matches } ] }
이 섹션에서는 자연어 -> 학습의 고급 NLP 설정 섹션에 나와 있는 설정을 참조합니다. 설정에 대한 자세한 내용은 여기를 참조하세요. 다음은 위에서 언급한 고급 NLP 구성을 설정하기 위한 샘플 요청입니다.
{ "advancedNLPSettings":[ { "configurationKeyName": "NoneIntent", "configurationValue":true, "nlpEngine":"ML" } ] }
다음은 허용 가능한 고급 NLP 설정 및 가능한 값의 전체 목록입니다. 복합어 분할
{ "configurationName": "Split Compound Words", "configurationKeyName": "splitCompoundWords", "desc": "The settings enables splitting of the compound words into multiple stems and then process the individual stem", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": false, "requiresTraining": true, "language": ["de", "nl"], "isChild": false }
의도 없음
{ "configurationName": "None Intent", "configurationKeyName": "NoneIntent", "desc": "Once enabled, a None intent is created which reduces the chances of getting a false positive for an intent match using ML engine", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": true, "language": "ALL", "isChild": false }
코사인 유사도 감소
{ "configurationName": "Cosine similarity dampening", "configurationKeyName": "cosineSimilarityDampening", "desc": "Avoid penalty on short length questions using Cosine Similarity Dampening", "nlpEngine": "KG", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": false, "language": "ALL", "isChild": false }
네트워크 유형
{ "configurationName" : "Network Type", "configurationKeyName" : "network", "desc" : "Networks available for intent training", "nlpEngine" : "ML", "dataType" : "enum", "range" : ["Standard","MLP-BOW","MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"], "defaultValue": "Standard", "requiresTraining" : true, "language" : "ALL", "isChild" : false }
에포크(Epoch)
{ "configurationName": "Epochs", "configurationKeyName": "epochs", "desc": "Number of iterations in training the model", "nlpEngine": "ML", "dataType": "Number", "range": [20, 300], "defaultValue": 20, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
배치 크기
{ "configurationName" : "Batch Size", "configurationKeyName" : "batch_size", "desc" : "Number of training samples used for each batch while training", "nlpEngine" : "ML", "dataType" : "Number", "range" : [10,30], "defaultValue":10, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
학습률
{ "configurationName": "Learning rate", "configurationKeyName": "lr", "desc": "Learning rate is a hyper-parameter that controls how much we are adjusting the weights of our network with respect to the loss gradient", "nlpEngine": "ML", "dataType": "enum", "range": [1e-4, 1e-3, 1e-2], "defaultValue": 1e-3, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
Dropout
{ "configurationName": "Dropout", "configurationKeyName": "dropout", "desc": "Regularization parameter to avoid overfitting of the model", "nlpEngine": "ML", "dataType": "Number", "range": [0, 0.8], "defaultValue": 0, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
벡터화
{ "configurationName": "Vectorizer", "configurationKeyName": "vector_type", "desc": "Feature extraction technique on training data", "nlpEngine": "ML", "dataType": "enum", "range": ["count", "tfidf"], "defaultValue": "count", "requiresTraining": true, "language": "ALL", "isChild": true, "parentConfiguration": "network", "requiredParentInput": ["MLP-BOW"] }
최대 시퀀스 길이
{ "configurationName": "Maximum sequence length", "configurationKeyName": "max_seq_length", "desc": "Length of the training sample or user input", "nlpEngine": "ML", "dataType": "Number", "range": [10, 30], "defaultValue": 20, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
임베딩 유형
{ "configurationName": "Embeddings Type", "configurationKeyName": "word_embedding_type", "desc": "Feature extraction technique on training data", "nlpEngine": "ML", "dataType": "enum", "range": ["generated", "pretrained", "random"], "defaultValue": "random", "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
임베딩 차원
{ "configurationName": "Embeddings Dimensions", "configurationKeyName": "embedding_dim", "desc": "Embeddings Dimensions to be used in featurization", "nlpEngine": "ML", "dataType": "Number", "range": [100, 400], "defaultValue": 300, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
K Fold 교차 검증
{ "configurationName" : "kfold", "configurationKeyName" : "kfold", "desc" : "kfold parameter for Crossvalidation", "nlpEngine" : "ML", "dataType" : "Number", "range" : [2,10], "defaultValue": 5, "requiresTraining" : true, "language" : "ALL", "isChild" : false }
의도 이름으로서의 FAQ 이름
{ "configurationName": "FAQ Name as Intent Name", "configurationKeyName": "FAQ_Name_Intent_Name", "desc": "Enable to use FAQ Name as Intent Name. ", "nlpEngine": "KG", "dataType": "Boolean", "range": [true, false], "defaultValue": false, "requiresTraining" : false, "language" : "ALL", "isChild" : false }
퍼지 매치
{ "configurationName" : "Fuzzy Match", "configurationKeyName" : "fuzzyMatch", "desc" : "This setting enables the use of the fuzzy matching algorithm for intent identification", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": true, "requiresTraining" : false, "language" : "ALL", "isChild" : false }
부정어 처리
{ "configurationName" : "Handle Negation", "configurationKeyName" : "f_negation", "desc" : "This setting enables the handling of negated words in intent identification", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": true, "requiresTraining" : true, "language" : ["en", "es"], "isChild" : false }
다중 발생 무시
{ "configurationName" : "Ignore Multiple occurences", "configurationKeyName" : "binary", "desc" : "This setting enables to just use presence or absence of a term instead of the raw counts", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": false, "requiresTraining" : true, "language" : ["en"], "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW"] }
사용자 발화의 엔티티 플레이스홀더
{ "configurationName": "Test PlaceHolders", "configurationKeyName": "TestPlaceHolders", "desc": "Enable to replace entity values present in the user input with the corresponding entity placeholders during prediction", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": false, "language": "ALL", "isChild": false }
설정을 삭제하려면 위 섹션에서 언급한 설정 이름을 다음과 같이 사용합니다.
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 '{ "delete": { "advancedNLPSettings": [ "kfold" ] } }'
설정을 재설정하려면 위 섹션에서 언급한 설정 이름을 다음과 같이 사용합니다.
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 '{ "reset": { "faq": [ "pathCoverage", // Path Coverage "suggestionsCount", // KG suggestionsCount "minimumAndDefinitiveLevels", // Minimum and Definitive Level for Knowledge Tasks (will reset all three values) "taskMatchTolerance" // Proximity of Suggested Matches ], "ml": [ "exactMatchThreshold", // ML Definitive Score "minThreshold" // ML threshold ], "rr": [ "taskMatchTolerance", // Proximity of Probable Matches "minMatchVal" // Minimum Match Score ], "mlParams": [ "ngram", // ngram Sequence Length "seqLength", // Sequence Length "maxSkipDistance" // Maximum Skip Distance ] } }'
다음과 같이 헤더에 JWT와 API를 호출합니다. auth: {{JWT}}
application/json
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 } }'
[ { "message": "Training Queued.", "Training_ID": "5d14b03edba48abcb44375a1" } ]
NLPのしきい値や設定を更新します
このAPIを使用するために、アプリは [NLP設定] のボットビルダーのAPIスコープを必要とします。あるいは、[テストとトレーニング] にある [NLP設定] の管理者のAPIスコープを必要とします。
POST https://{{host}}/api/public/bot/{{BotID}}/configurations?language={{languageCode}}&groupName={{groupName}}
パラメータ | 必須/任意 | 説明 |
---|---|---|
ホスト | 必須 | 環境URL(例: https://bots.kore.ai) |
BotID | 必須 | ボットIDまたはストリームID。ボットの [一般設定] ページからアクセスすることができます。 |
languageCode | 必須 | これらの設定を更新する必要があるボットの言語。 |
groupName | 複数のMLモデルに必須 | GroupNameは、特定のグループのMLパラメタを更新するために使用することができます。 ボットレベルのインテントモデルの設定を更新するには、groupNameを「ボットレベルのインテントモデル」に設定する必要があります。 |
パラメータは、更新が必要なしきい値の設定に応じて異なります。以下は、様々なしきい値の設定の包括的なパラメータリストです。
このセクションでは、機械学習エンジンに関する設定について説明します。設定の詳細についてはこちらを参照してください。
{ "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": "n_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": 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 } } }
このセクションでは、ファンダメンタルミーニングエンジンに関する設定について説明します。設定の詳細についてはこちらを参照してください。
{ "configurations": [ { "mode": "cs", // Fundamental Meaning Engine "labelMatch": true // Intent Detection using Task Name Words "isFMThreshold": true, //FM Threshold "fmThreshold": 15 //FM Threshold value } ] }
このセクションでは、ナレッジグラフエンジンに関する設定について説明します。設定の詳細についてはこちらを参照してください。
{ "configurations": [ THRESHOLDS & CONFIGURATIONS { "mode": "faq", "autoSpellCorrectEnabled": true, // Auto Correction "useBotSynonyms": true, // Bot Synonyms "enPatternLemma": false, // Lemmatization using Parts of Speech "pathCoverage": 50, // Path Coverage - value in range [0-100] "exactMatchThreshold": 95, // Minimum and Definitive Level for Knowledge Tasks // value in range [0-100] // should be more than minThreshold & maxThreshold "maxThreshold": 80, // Probable range for Knowledge Task // value in range [0-100] // should be between minThreshold & exactMatchThreshold "minThreshold": 60, // Low confidence range for Knowledge Task // value in range [0-100] // should be less than maxThreshold & exactMatchThreshold "suggestionsCount": 3, // KG suggestionsCount | [0-5] "taskMatchTolerance": 35, // Proximity of Suggested Matches | [0-50] "longResponses": { "readMore": true, // Manage Long Responses "useCustomReadMoreURL": true, // readMore should be true "customReadMoreURL": "www.siteurl.com" // readMore link; readMore should be true }, "searchInAnswer": { "enabled": true, // Search in Answer "notifyUser": true, // Inform end user that it is a probable answer "responseType": "relevantWithReadMore", // can be "complete" - Show complete response, // or "relevant" - Show only the relevant paragraph, // or "relevantWithReadMore" - Show only the relevant paragraph with “read more” link ] "customReadMoreURL": "www.siteurl.com", // “read more” link "useCustomReadMoreURL": true // enabled should be true } "qualifyContextualPaths": false, // Qualify Contextual Paths } ] }
このセクションでは、ランキングおよび解決エンジンに関する設定について説明します。設定の詳細についてはこちらを参照してください。
{ "configurations": { "mode": "rr", // Ranking and Resolver Engine "taskMatchTolerance": 2, // Proximity of Probable Matches - value in range [0-20] "useDependencyParser": true, // Dependency Parsing Model "minMatchVal": 0.4, // Minimum Match Score - value in range [0-1] // useDependencyParser should be true "rankingParameters": "" // Advanced Configurations // useDependencyParser should be true "intentRescoring": false, // Rescoring of Intents "isPreferDefinitiveMatch": true // Prefer Definitive Matches } ] }
このセクションでは、[自然言語] > [トレーニング] の [高度なNLP設定] に記載されている設定について説明します。設定の詳細についてはこちらを参照してください。以下は、上記の [高度なNLP設定] を設定するためのリクエストのサンプルです。
{ "advancedNLPSettings":[ { "configurationKeyName": "NoneIntent", "configurationValue":true, "nlpEngine":"ML" } ] }
以下は、許容されるNLPの詳細設定と考えられる値の完全なリストです。複合語を分割
{ "configurationName": "複合語を分割", "configurationKeyName": "splitCompoundWords", "desc": "この設定により、複合語を複数の語幹に分割してから、個々の語幹を処理することができます", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": false, "requiresTraining": true, "language": ["de", "nl"], "isChild": false }
Noneインテント
{ "configurationName": "Noneインテント", "configurationKeyName": "NoneIntent", "desc": "有効にすると、機械学習エンジンを使用してインテント一致の偽陽性が発生する可能性を減らす、Noneインテントが作成されます", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": true, "language": "ALL", "isChild": false }
コサイン類似性の減衰
{ "configurationName": "コサイン類似性の減衰", "configurationKeyName": "cosineSimilarityDampening", "desc": "コサイン類似性の減衰を使用して、短文の質問のペナルティを回避します", "nlpEngine": "KG", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": false, "language": "ALL", "isChild": false }
ネットワークタイプ
{ "configurationName" : "ネットワークタイプ", "configurationKeyName" : "network", "desc" : "インテントのトレーニングに利用できるネットワーク", "nlpEngine" : "ML", "dataType" : "enum", "range" : ["Standard","MLP-BOW","MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"], "defaultValue": "Standard", "requiresTraining" : true, "language" : "ALL", "isChild" : false }
Epochs
{ "configurationName": "Epochs", "configurationKeyName": "epochs", "desc": "モデルのトレーニングにおける反復回数", "nlpEngine": "ML", "dataType": "Number", "range": [20, 300], "defaultValue": 20, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
バッチサイズ
{ "configurationName" : "バッチサイズ", "configurationKeyName" : "batch_size", "desc" : "トレーニング時に各バッチで使用されるトレーニングサンプルの数", "nlpEngine" : "ML", "dataType" : "Number", "range" : [10,30], "defaultValue":10, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
学習率
{ "configurationName": "学習率", "configurationKeyName": "lr", "desc": "学習率は、損失勾配に対してネットワークの重みをどの程度調整するかを制御するハイパーパラメータです", "nlpEngine": "ML", "dataType": "enum", "range": [1e-4, 1e-3, 1e-2], "defaultValue": 1e-3, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
Dropout
{ "configurationName": "Dropout", "configurationKeyName": "dropout", "desc": "モデルの過学習を避けるための正則化パラメータ", "nlpEngine": "ML", "dataType": "Number", "range": [0, 0.8], "defaultValue": 0, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
Vectorizer
{ "configurationName": "Vectorizer", "configurationKeyName": "vector_type", "desc": "トレーニングデータからの特徴抽出手法", "nlpEngine": "ML", "dataType": "enum", "range": ["count", "tfidf"], "defaultValue": "count", "requiresTraining": true, "language": "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput": ["MLP-BOW"] }
最大シーケンス長
{ "configurationName": "最大シーケンス長", "configurationKeyName": "max_seq_length", "desc": "トレーニングサンプルまたはユーザー入力の長さ", "nlpEngine": "ML", "dataType": "Number", "range": [10, 30], "defaultValue": 20, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
埋め込みタイプ
{ "configurationName": "埋め込みタイプ", "configurationKeyName": "word_embedding_type", "desc": "トレーニングデータからの特徴抽出手法", "nlpEngine": "ML", "dataType": "enum", "range": ["generated", "pretrained", "random"], "defaultValue": "random", "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
埋め込み範囲
{ "configurationName": "埋め込み範囲", "configurationKeyName": "embedding_dim", "desc": "特徴量化で使用される埋め込み範囲", "nlpEngine": "ML", "dataType": "Number", "range": [100, 400], "defaultValue": 300, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
K-分割交差検証
{ "configurationName" : "kfold", "configurationKeyName" : "kfold", "desc" : "交差検証のK-分割パラメータ", "nlpEngine" : "ML", "dataType" : "Number", "range" : [2,10], "defaultValue": 5, "requiresTraining" : true, "language" : "ALL", "isChild" : false }
インテント名としてのFAQ名
{ "configurationName": "インテント名としてのFAQ名", "configurationKeyName": "FAQ_Name_Intent_Name", "desc": "FAQ名のインテント名としての使用を有効にします。", "nlpEngine": "KG", "dataType": "Boolean", "range": [true, false], "defaultValue": false, "requiresTraining" : false, "language" : "ALL", "isChild" : false }
ファジーマッチ
{ "configurationName" : "ファジーマッチ", "configurationKeyName" : "fuzzyMatch", "desc" : "この設定では、ファジー・マッチング・アルゴリズムを使用してインテントを検出することができます", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": true, "requiresTraining" : false, "language" : "ALL", "isChild" : false }
否定の処理
{ "configurationName" : "否定の処理", "configurationKeyName" : "f_negation", "desc" : "この設定では、インテント検出で否定された単語を処理することができます", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": true, "requiresTraining" : true, "language" : ["en", "es"], "isChild" : false }
多重発生を無視
{ "configurationName" : "多重発生を無視", "configurationKeyName" : "binary", "desc" : "この設定では、生カウント数ではなく、用語の有無だけを使用することができます", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": false, "requiresTraining" : true, "language" : ["en"], "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW"] }
ユーザーの発話に含まれるエンティティのプレースホルダ
{ "configurationName": "Test PlaceHolders", "configurationKeyName": "TestPlaceHolders", "desc": "予測時に、ユーザー入力に含まれるエンティティ値を、対応するエンティティプレースホルダで置き換えることを可能にします", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": false, "language": "ALL", "isChild": false }
設定を削除するには、上記のセクションに記載されている設定の名前を使用して、このように行います。
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 '{ "delete": { "advancedNLPSettings": [ "kfold" ] } }'
設定をリセットするには、上記のセクションに記載されている設定の名前を使用して、このように行います。
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 '{ "reset": { "faq": [ "pathCoverage", // Path Coverage "suggestionsCount", // KG suggestionsCount "minimumAndDefinitiveLevels", // Minimum and Definitive Level for Knowledge Tasks (will reset all three values) "taskMatchTolerance" // Proximity of Suggested Matches ], "ml": [ "exactMatchThreshold", // ML Definitive Score "minThreshold" // ML threshold ], "rr": [ "taskMatchTolerance", // Proximity of Probable Matches "minMatchVal" // Minimum Match Score ], "mlParams": [ "ngram", // ngram Sequence Length "seqLength", // Sequence Length "maxSkipDistance" // Maximum Skip Distance ] } }'
以下のように、JWTをヘッダーに含むAPIを呼び出します。 auth: {{JWT}}
application/json
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": { "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 } }'
[ { "message": "Training Queued.", "Training_ID": "5d14b03edba48abcb44375a1" } ]
To update the NLP thresholds and configurations
To use this API, app needs the Bot Builder API scope of NLP Configurations.
OR the Admin API Scope of NLP Configurations under Test and Train.
POST https://{{host}}/api/public/bot/{{BotID}}/configurations?language={{languageCode}}&groupName={{groupName}}
Parameter | Required/Optional | Description |
---|---|---|
host | Required | Environment URL, for example, https://bots.kore.ai |
BotID | Required | Bot ID or Stream ID. You can access it from the General Settings page of the bot. |
languageCode | Required | Bot language to which these configurations need to be updated. |
groupName | Required for Multiple ML Model |
GroupName can be used to update the ML params of a specific group. To update Bot level Intent Model Configurations groupName should be set to “Bot Level Intent Model”. |
The parameters would depend upon the threshold configuration that needs to be updated. Following is the comprehensive list of parameters for the various threshold configurations.
This section refers to the configurations related to the Machine Learning engine. For details about the configurations refer 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": "n_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": 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 } } }
This section refers to the configurations related to the Fundamental Meaning engine. For details about the configurations refer here.
{ "configurations": [ { "mode": "cs", // Fundamental Meaning Engine "labelMatch": true // Intent Detection using Task Name Words "isFMThreshold": true, //FM Threshold "fmThreshold": 15 //FM Threshold value } ] }
This section refers to the configurations related to the Knowledge Graph engine. For details about the configurations refer here.
{ "configurations": [ THRESHOLDS & CONFIGURATIONS { "mode": "faq", "autoSpellCorrectEnabled": true, // Auto Correction "useBotSynonyms": true, // Bot Synonyms "enPatternLemma": false, // Lemmatization using Parts of Speech "pathCoverage": 50, // Path Coverage - value in range [0-100] "exactMatchThreshold": 95, // Minimum and Definitive Level for Knowledge Tasks // value in range [0-100] // should be more than minThreshold & maxThreshold "maxThreshold": 80, // Probable range for Knowledge Task // value in range [0-100] // should be between minThreshold & exactMatchThreshold "minThreshold": 60, // Low confidence range for Knowledge Task // value in range [0-100] // should be less than maxThreshold & exactMatchThreshold "suggestionsCount": 3, // KG suggestionsCount | [0-5] "taskMatchTolerance": 35, // Proximity of Suggested Matches | [0-50] "longResponses": { "readMore": true, // Manage Long Responses "useCustomReadMoreURL": true, // readMore should be true "customReadMoreURL": "www.siteurl.com" // readMore link; readMore should be true }, "searchInAnswer": { "enabled": true, // Search in Answer "notifyUser": true, // Inform end user that it is a probable answer "responseType": "relevantWithReadMore", // can be "complete" - Show complete response, // or "relevant" - Show only the relevant paragraph, // or "relevantWithReadMore" - Show only the relevant paragraph with “read more” link ] "customReadMoreURL": "www.siteurl.com", // “read more” link "useCustomReadMoreURL": true // enabled should be true } "qualifyContextualPaths": false, // Qualify Contextual Paths } ] }
This section refers to the configurations related to the Ranking & Resolver engine. For details about the configurations refer here.
{ "configurations": { "mode": "rr", // Ranking and Resolver Engine "taskMatchTolerance": 2, // Proximity of Probable Matches - value in range [0-20] "useDependencyParser": true, // Dependency Parsing Model "minMatchVal": 0.4, // Minimum Match Score - value in range [0-1] // useDependencyParser should be true "rankingParameters": "" // Advanced Configurations // useDependencyParser should be true "intentRescoring": false, // Rescoring of Intents "isPreferDefinitiveMatch": true // Prefer Definitive Matches } ] }
This section refers to the configurations as given in the Advanced NLP Configurations section of Natural Language -> Training. For details about the configurations refer here.
Following is the sample request for setting the above-mentioned Advanced NLP Configurations.
{ "advancedNLPSettings":[ { "configurationKeyName": "NoneIntent", "configurationValue":true, "nlpEngine":"ML" } ] }
Following is the complete list of the permissible advanced NLP configurations settings and the possible values:
Split Compound Words
{ "configurationName": "Split Compound Words", "configurationKeyName": "splitCompoundWords", "desc": "The settings enables splitting of the compound words into multiple stems and then process the individual stem", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": false, "requiresTraining": true, "language": ["de", "nl"], "isChild": false }
None Intent
{ "configurationName": "None Intent", "configurationKeyName": "NoneIntent", "desc": "Once enabled, a None intent is created which reduces the chances of getting a false positive for an intent match using ML engine", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": true, "language": "ALL", "isChild": false }
Cosine similarity dampening
{ "configurationName": "Cosine similarity dampening", "configurationKeyName": "cosineSimilarityDampening", "desc": "Avoid penalty on short length questions using Cosine Similarity Dampening", "nlpEngine": "KG", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": false, "language": "ALL", "isChild": false }
Network Type
{ "configurationName" : "Network Type", "configurationKeyName" : "network", "desc" : "Networks available for intent training", "nlpEngine" : "ML", "dataType" : "enum", "range" : ["Standard","MLP-BOW","MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"], "defaultValue": "Standard", "requiresTraining" : true, "language" : "ALL", "isChild" : false }
Epochs
{ "configurationName": "Epochs", "configurationKeyName": "epochs", "desc": "Number of iterations in training the model", "nlpEngine": "ML", "dataType": "Number", "range": [20, 300], "defaultValue": 20, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
Batch Size
{ "configurationName" : "Batch Size", "configurationKeyName" : "batch_size", "desc" : "Number of training samples used for each batch while training", "nlpEngine" : "ML", "dataType" : "Number", "range" : [10,30], "defaultValue":10, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
Learning rate
{ "configurationName": "Learning rate", "configurationKeyName": "lr", "desc": "Learning rate is a hyper-parameter that controls how much we are adjusting the weights of our network with respect to the loss gradient", "nlpEngine": "ML", "dataType": "enum", "range": [1e-4, 1e-3, 1e-2], "defaultValue": 1e-3, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
Dropout
{ "configurationName": "Dropout", "configurationKeyName": "dropout", "desc": "Regularization parameter to avoid overfitting of the model", "nlpEngine": "ML", "dataType": "Number", "range": [0, 0.8], "defaultValue": 0, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW","MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
Vectorizer
{ "configurationName": "Vectorizer", "configurationKeyName": "vector_type", "desc": "Feature extraction technique on training data", "nlpEngine": "ML", "dataType": "enum", "range": ["count", "tfidf"], "defaultValue": "count", "requiresTraining": true, "language": "ALL", "isChild": true, "parentConfiguration": "network", "requiredParentInput": ["MLP-BOW"] }
Maximum sequence length
{ "configurationName": "Maximum sequence length", "configurationKeyName": "max_seq_length", "desc": "Length of the training sample or user input", "nlpEngine": "ML", "dataType": "Number", "range": [10, 30], "defaultValue": 20, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN","KoreBERT"] }
Embeddings Type
{ "configurationName": "Embeddings Type", "configurationKeyName": "word_embedding_type", "desc": "Feature extraction technique on training data", "nlpEngine": "ML", "dataType": "enum", "range": ["generated", "pretrained", "random"], "defaultValue": "random", "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
Embeddings Dimensions
{ "configurationName": "Embeddings Dimensions", "configurationKeyName": "embedding_dim", "desc": "Embeddings Dimensions to be used in featurization", "nlpEngine": "ML", "dataType": "Number", "range": [100, 400], "defaultValue": 300, "requiresTraining" : true, "language" : "ALL", "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-WordEmbeddings","LSTM","CNN", "KoreBERT"] }
K Fold Cross-Validation
{ "configurationName" : "kfold", "configurationKeyName" : "kfold", "desc" : "kfold parameter for Crossvalidation", "nlpEngine" : "ML", "dataType" : "Number", "range" : [2,10], "defaultValue": 5, "requiresTraining" : true, "language" : "ALL", "isChild" : false }
FAQ Name as Intent Name
{ "configurationName": "FAQ Name as Intent Name", "configurationKeyName": "FAQ_Name_Intent_Name", "desc": "Enable to use FAQ Name as Intent Name. ", "nlpEngine": "KG", "dataType": "Boolean", "range": [true, false], "defaultValue": false, "requiresTraining" : false, "language" : "ALL", "isChild" : false }
Fuzzy Match
{ "configurationName" : "Fuzzy Match", "configurationKeyName" : "fuzzyMatch", "desc" : "This setting enables the use of the fuzzy matching algorithm for intent identification", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": true, "requiresTraining" : false, "language" : "ALL", "isChild" : false }
Handle Negation
{ "configurationName" : "Handle Negation", "configurationKeyName" : "f_negation", "desc" : "This setting enables the handling of negated words in intent identification", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": true, "requiresTraining" : true, "language" : ["en", "es"], "isChild" : false }
Ignore Multiple Occurences
{ "configurationName" : "Ignore Multiple occurences", "configurationKeyName" : "binary", "desc" : "This setting enables to just use presence or absence of a term instead of the raw counts", "nlpEngine" : "ML", "dataType" : "Boolean", "range" : [true,false], "defaultValue": false, "requiresTraining" : true, "language" : ["en"], "isChild" : true, "parentConfiguration" : "network", "requiredParentInput" : ["MLP-BOW"] }
Entity Placeholders in User Utterances
{ "configurationName": "Test PlaceHolders", "configurationKeyName": "TestPlaceHolders", "desc": "Enable to replace entity values present in the user input with the corresponding entity placeholders during prediction", "nlpEngine": "ML", "dataType": "Boolean", "range": [true, false], "defaultValue": true, "requiresTraining": false, "language": "ALL", "isChild": false }
To delete any settings use the name of the settings mentioned in above sections in this way:
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 '{ "delete": { "advancedNLPSettings": [ "kfold" ] } }'
To reset any settings use the name of the settings mentioned in above sections in this way:
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 '{ "reset": { "faq": [ "pathCoverage", // Path Coverage "suggestionsCount", // KG suggestionsCount "minimumAndDefinitiveLevels", // Minimum and Definitive Level for Knowledge Tasks (will reset all three values) "taskMatchTolerance" // Proximity of Suggested Matches ], "ml": [ "exactMatchThreshold", // ML Definitive Score "minThreshold" // ML threshold ], "rr": [ "taskMatchTolerance", // Proximity of Probable Matches "minMatchVal" // Minimum Match Score ], "mlParams": [ "ngram", // ngram Sequence Length "seqLength", // Sequence Length "maxSkipDistance" // Maximum Skip Distance ] } }'
Invoke the API with JWT in the header as follows:
auth: {{JWT}}
application/json
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 } }'
[ { "message": "Training Queued.", "Training_ID": "5d14b03edba48abcb44375a1" } ]