의도 인식 결과와 NLP 및 ML 엔진의 점수를 모두 매겨줍니다.
이 API를 사용하려면 앱은 의도 및 입력 감지의 봇 빌더 API 범위가 필요합니다.
POST https://{{host}}/api/v1.1/rest/bot/{{BotID}}/findIntent?fetchConfiguredTasks=false
의도 인식 결과와 NLP 및 ML 엔진의 점수를 모두 매겨줍니다.
이 API를 사용하려면 앱은 의도 및 입력 감지의 봇 빌더 API 범위가 필요합니다.
POST https://{{host}}/api/v1.1/rest/bot/{{BotID}}/findIntent?fetchConfiguredTasks=false
매개 변수 | 설명 |
---|---|
host | 환경 URL(예: https://bots.kore.ai) |
BotID | 봇 ID입니다. 봇의 일반 설정 페이지에서 이를 액세스할 수 있습니다. |
fetchConfiguredTasks | 봇에 설정된 작업에서 의도를 가져오려면 참이고 게시된 작업에 대해서만 가져오려면 거짓 입니다. |
매개 변수 | 설명 |
---|---|
parentIntent | 다중 의도 모델을 지원합니다. |
input | 일치하는 의도를 찾기 위한 사용자 발화 예: 작업 생성 |
streamName | 일치하는 의도를 찾기 위한 사용자 발화 예: 작업 생성 참고 사항: 3,000자를 초과하는 길이의 긴 발화는 허용되지 않습니다. |
다음 구문을 포함한 헤더에 JWT를 포함한 API를 호출합니다. auth: {{JWT}}
선택적으로 봇에 대해 다중 언어를 사용하도록 설정한 경우, 봇 언어 헤더를 en, zh_cn 등의 언어 코드와 함께 전달해야 합니다. 다국어 봇에 언어 코드가 전달되지 않았다면 봇의 기본 언어가 고려됩니다. bot-header: {{lang-code}}
application/json
curl -X POST \ 'https://{{host}}/api/v1.1/rest/bot/{{BotID}}/findIntent?fetchConfiguredTasks=false' \ -H "Content-Type:application/json" \ -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}'\ -H "bot-language:{{lang-code}}" \ -d '{ "parentIntent": "{{parent intent}}", "input": "{{user utterance}}", "streamName": "{{bot name}}" }'
{ "request": { "input": "book a ticket", "streamName": "Public APIs" }, "response": { "usedtime": 313, "debugTitle": "Intent Match Successful: 'Book a ticket'", "result": "successintent", "messageStoreId": "xxx", "bot": "Public APIs", "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "task": "Book a ticket", "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "intentStatus": "published", "subType": "dialog", "input": [ "book a ticket" ], "identifiedVia": "cs em", "language": "en", "userId": "u-5dad2ccd-b271-5c00-a338-2e6e25e1ec91", "time": "2019-06-27T11:48:28.250Z", "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "traits": {}, "toneAnalysis": {}, "nlProcessing": { "originalInput": "book a ticket", "canonical": "book a ticket", "wordAnalysis": [ { "word": "book", "ignored": false, "pos": "Verb_infinitive ", "role": "MAINVERB ", "original": "book", "processedWord": "book" }, { "word": "a", "ignored": true, "pos": "Determiner ", "original": "a", "processedWord": "a" }, { "word": "ticket", "ignored": false, "pos": "Noun_singular ", "role": "MAINOBJECT ", "original": "ticket", "processedWord": "ticket" } ] }, "ml": { "namedEntityRecognition": [] }, "fm": { "definitive": [ { "count": 2, "score": 11643.33, "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "botname": "Public APIs", "activity": "Book a ticket", "activityType": 1, "exactcount": 2, "labelsize": 2, "ignorewords": 1, "mask": 66306, "words": { "book": [ "0-1" ], "ticket": [ "0-3" ] }, "priority": 2, "tense": 8192, "mainRoles": 10, "sentencelength": 3, "ignorewordlist": { "a": 1 }, "maskEntity": 66306, "firstwordmatch": "book", "details": { "0": { "1": { "labelword": "book", "inputwords": { "1": "book" }, "wordindex": [ 1 ], "foundexact": true, "bestwordindex": 1, "role": 2, "pos": 2200096997376, "tense": 8192, "ageLevel": 1, "commonness": 6 }, "2": { "labelword": "ticket", "inputwords": { "3": "ticket" }, "wordindex": [ 3 ], "foundexact": true, "bestwordindex": 3, "role": 8, "pos": 2147483680, "tense": 8192, "ageLevel": 1, "commonness": 5 } } }, "hasNoun": true, "hasVerb": true, "ageLevel": 1, "foundFmEngine": true, "scoreBreakdown": { "wordMatch": 500, "exactWords": 60, "coverage": 2000, "sentenceBonus": 4000, "positionBonus": 733.33, "orderBonus": 100, "spreadBonus": 800, "roleBonus": 2900, "faqQuestionBonus": 0, "mlMatchBonus": 0, "tasktypeBonus": 50, "matchBonus": 500, "phraseJoinPenalty": 0 }, "matchType": "definite", "task": "Book a ticket", "state": "published", "foundVia": "wordMatch" } ] }, "finalResolver": { "ranking": [ { "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "intent": "Book a ticket", "activityType": "dialog", "state": "published", "totalScore": 11643.33, "scoring": { "count": 2, "score": 11643.33, "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "botname": "Public APIs", "activity": "Book a ticket", "activityType": 1, "exactcount": 2, "labelsize": 2, "ignorewords": 1, "mask": 66306, "words": { "book": [ "0-1" ], "ticket": [ "0-3" ] }, "priority": 10, "tense": 8192, "mainRoles": 10, "sentencelength": 3, "ignorewordlist": { "a": 1 }, "maskEntity": 66306, "firstwordmatch": "book", "details": { "0": { "1": { "labelword": "book", "inputwords": { "1": "book" }, "wordindex": [ 1 ], "foundexact": true, "bestwordindex": 1, "role": 2, "pos": 2200096997376, "tense": 8192, "ageLevel": 1, "commonness": 6 }, "2": { "labelword": "ticket", "inputwords": { "3": "ticket" }, "wordindex": [ 3 ], "foundexact": true, "bestwordindex": 3, "role": 8, "pos": 2147483680, "tense": 8192, "ageLevel": 1, "commonness": 5 } } }, "hasNoun": true, "hasVerb": true, "ageLevel": 1, "foundFmEngine": true, "scoreBreakdown": { "wordMatch": 500, "exactWords": 60, "coverage": 2000, "sentenceBonus": 4000, "positionBonus": 733.33, "orderBonus": 100, "spreadBonus": 800, "roleBonus": 2900, "faqQuestionBonus": 0, "mlMatchBonus": 0, "tasktypeBonus": 50, "matchBonus": 500, "phraseJoinPenalty": 0 }, "matchType": "definite", "csMatch": true }, "identifyingEngines": { "fm": true }, "csMatch": true, "intentMatchVia": "wordMatch" } ], "userInput": "book a ticket", "winningIntent": [ { "intent": "Book a ticket", "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "activityType": "dialog", "state": "published", "score": 11643.33 } ], "entities": [] } }, "streamId": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "streamName": "Public APIs", "seqLogId": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "name": "Public APIs", "input": [ "book a ticket" ] }
NLPエンジンおよびMLエンジンからインテントの認識結果やスコアリングを取得します。
このAPIを使用するために、アプリは [インテントおよびエンティティの検出] の [ボットビルダーのAPIスコープ] を必要とします。
ポスト https://{{host}}/api/v1.1/rest/bot/{{BotID}}/findIntent?fetchConfiguredTasks=false
パラメータ | 説明 |
---|---|
ホスト | 環境URL(例: https://bots.kore.ai) |
ボットID | ボットID。ボットの [一般設定] ページからアクセスすることができます。 |
fetchConfiguredTasks | ボットの設定済みタスクからインテントを取得する場合は「True」、公開済みタスクのみを取得する場合は「False」となります |
パラメータ | 説明 |
---|---|
parentIntent | 複数インテントモデルをサポートします |
input | 一致するインテントを見つけるためのユーザーの発話 例:タスクを作成する |
streamName | 一致するインテントを見つけるためのユーザーの発話 例:タスクを作成する 注意:3,000文字を超える文字列は使用できません |
以下の構文を使用して、JWTをヘッダーに含むAPIを呼び出します。 auth: {{JWT}}
オプションとして、ボットで多言語を有効にしている場合は、en、zh_cnなどの言語コードを含むボット言語ヘッダーを渡す必要があります。多言語ボットの場合、言語コードが渡されない場合は、ボットのデフォルト言語が考慮されます。 bot-header: {{lang-code}}
application/json
curl -X POST \ 'https://{{host}}/api/v1.1/rest/bot/{{BotID}}/findIntent?fetchConfiguredTasks=false' \ -H "Content-Type:application/json" \ -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}'\ -H "bot-language:{{lang-code}}" \ -d '{ "parentIntent": "{{parent intent}}", "input": "{{user utterance}}", "streamName": "{{bot name}}" }'
{ "request": { "input": "book a ticket", "streamName": "Public APIs" }, "response": { "usedtime": 313, "debugTitle": "Intent Match Successful: 'Book a ticket'", "result": "successintent", "messageStoreId": "xxx", "bot": "Public APIs", "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "task": "Book a ticket", "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "intentStatus": "published", "subType": "dialog", "input": [ "book a ticket" ], "identifiedVia": "cs em", "language": "en", "userId": "u-5dad2ccd-b271-5c00-a338-2e6e25e1ec91", "time": "2019-06-27T11:48:28.250Z", "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "traits": {}, "toneAnalysis": {}, "nlProcessing": { "originalInput": "book a ticket", "canonical": "book a ticket", "wordAnalysis": [ { "word": "book", "ignored": false, "pos": "Verb_infinitive ", "role": "MAINVERB ", "original": "book", "processedWord": "book" }, { "word": "a", "ignored": true, "pos": "Determiner ", "original": "a", "processedWord": "a" }, { "word": "ticket", "ignored": false, "pos": "Noun_singular ", "role": "MAINOBJECT ", "original": "ticket", "processedWord": "ticket" } ] }, "ml": { "namedEntityRecognition": [] }, "fm": { "definitive": [ { "count": 2, "score": 11643.33, "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "botname": "Public APIs", "activity": "Book a ticket", "activityType": 1, "exactcount": 2, "labelsize": 2, "ignorewords": 1, "mask": 66306, "words": { "book": [ "0-1" ], "ticket": [ "0-3" ] }, "priority": 2, "tense": 8192, "mainRoles": 10, "sentencelength": 3, "ignorewordlist": { "a": 1 }, "maskEntity": 66306, "firstwordmatch": "book", "details": { "0": { "1": { "labelword": "book", "inputwords": { "1": "book" }, "wordindex": [ 1 ], "foundexact": true, "bestwordindex": 1, "role": 2, "pos": 2200096997376, "tense": 8192, "ageLevel": 1, "commonness": 6 }, "2": { "labelword": "ticket", "inputwords": { "3": "ticket" }, "wordindex": [ 3 ], "foundexact": true, "bestwordindex": 3, "role": 8, "pos": 2147483680, "tense": 8192, "ageLevel": 1, "commonness": 5 } } }, "hasNoun": true, "hasVerb": true, "ageLevel": 1, "foundFmEngine": true, "scoreBreakdown": { "wordMatch": 500, "exactWords": 60, "coverage": 2000, "sentenceBonus": 4000, "positionBonus": 733.33, "orderBonus": 100, "spreadBonus": 800, "roleBonus": 2900, "faqQuestionBonus": 0, "mlMatchBonus": 0, "tasktypeBonus": 50, "matchBonus": 500, "phraseJoinPenalty": 0 }, "matchType": "definite", "task": "Book a ticket", "state": "published", "foundVia": "wordMatch" } ] }, "finalResolver": { "ranking": [ { "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "intent": "Book a ticket", "activityType": "dialog", "state": "published", "totalScore": 11643.33, "scoring": { "count": 2, "score": 11643.33, "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "botname": "Public APIs", "activity": "Book a ticket", "activityType": 1, "exactcount": 2, "labelsize": 2, "ignorewords": 1, "mask": 66306, "words": { "book": [ "0-1" ], "ticket": [ "0-3" ] }, "priority": 10, "tense": 8192, "mainRoles": 10, "sentencelength": 3, "ignorewordlist": { "a": 1 }, "maskEntity": 66306, "firstwordmatch": "book", "details": { "0": { "1": { "labelword": "book", "inputwords": { "1": "book" }, "wordindex": [ 1 ], "foundexact": true, "bestwordindex": 1, "role": 2, "pos": 2200096997376, "tense": 8192, "ageLevel": 1, "commonness": 6 }, "2": { "labelword": "ticket", "inputwords": { "3": "ticket" }, "wordindex": [ 3 ], "foundexact": true, "bestwordindex": 3, "role": 8, "pos": 2147483680, "tense": 8192, "ageLevel": 1, "commonness": 5 } } }, "hasNoun": true, "hasVerb": true, "ageLevel": 1, "foundFmEngine": true, "scoreBreakdown": { "wordMatch": 500, "exactWords": 60, "coverage": 2000, "sentenceBonus": 4000, "positionBonus": 733.33, "orderBonus": 100, "spreadBonus": 800, "roleBonus": 2900, "faqQuestionBonus": 0, "mlMatchBonus": 0, "tasktypeBonus": 50, "matchBonus": 500, "phraseJoinPenalty": 0 }, "matchType": "definite", "csMatch": true }, "identifyingEngines": { "fm": true }, "csMatch": true, "intentMatchVia": "wordMatch" } ], "userInput": "book a ticket", "winningIntent": [ { "intent": "Book a ticket", "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "activityType": "dialog", "state": "published", "score": 11643.33 } ], "entities": [] } }, "streamId": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "streamName": "Public APIs", "seqLogId": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "name": "Public APIs", "input": [ "book a ticket" ] }
Fetches the intent recognition result and the scoring from NLP and ML engines.
To use this API, the app needs the Bot Builder API scope of Intent and Entity Detection.
POST https://{{host}}/api/v1.1/rest/bot/{{BotID}}/findIntent?fetchConfiguredTasks=false
Parameter | Description |
---|---|
host | Environment URL, for example, https://bots.kore.ai |
BotID | Bot ID. You can access it from the General Settings page of the bot. |
fetchConfiguredTasks | true if you want to fetch the intents from configured tasks in the bot and false if you want to fetch only for the published tasks |
Parameter | Description |
---|---|
parentIntent | To support Multiple Intent Models |
input | The user utterance to find the matching intents Example: Create a task |
streamName | The user utterance to find the matching intents Example: Create a task Note: Utterances greater than 3,000 characters in length are not allowed |
Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}
Optionally, if multi-language is enabled for the Bot, you need to pass the bot-language header with the language code, eg en, zh_cn etc.. If the language code is not passed for a multi-lingual Bot, then the default language of the Bot will be considered.
bot-header: {{lang-code}}
application/json
curl -X POST \ 'https://{{host}}/api/v1.1/rest/bot/{{BotID}}/findIntent?fetchConfiguredTasks=false' \ -H "Content-Type:application/json" \ -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}'\ -H "bot-language:{{lang-code}}" \ -d '{ "parentIntent": "{{parent intent}}", "input": "{{user utterance}}", "streamName": "{{bot name}}" }'
{ "request": { "input": "book a ticket", "streamName": "Public APIs" }, "response": { "usedtime": 313, "debugTitle": "Intent Match Successful: 'Book a ticket'", "result": "successintent", "messageStoreId": "xxx", "bot": "Public APIs", "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "task": "Book a ticket", "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "intentStatus": "published", "subType": "dialog", "input": [ "book a ticket" ], "identifiedVia": "cs em", "language": "en", "userId": "u-5dad2ccd-b271-5c00-a338-2e6e25e1ec91", "time": "2019-06-27T11:48:28.250Z", "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "traits": {}, "toneAnalysis": {}, "nlProcessing": { "originalInput": "book a ticket", "canonical": "book a ticket", "wordAnalysis": [ { "word": "book", "ignored": false, "pos": "Verb_infinitive ", "role": "MAINVERB ", "original": "book", "processedWord": "book" }, { "word": "a", "ignored": true, "pos": "Determiner ", "original": "a", "processedWord": "a" }, { "word": "ticket", "ignored": false, "pos": "Noun_singular ", "role": "MAINOBJECT ", "original": "ticket", "processedWord": "ticket" } ] }, "ml": { "namedEntityRecognition": [] }, "fm": { "definitive": [ { "count": 2, "score": 11643.33, "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "botname": "Public APIs", "activity": "Book a ticket", "activityType": 1, "exactcount": 2, "labelsize": 2, "ignorewords": 1, "mask": 66306, "words": { "book": [ "0-1" ], "ticket": [ "0-3" ] }, "priority": 2, "tense": 8192, "mainRoles": 10, "sentencelength": 3, "ignorewordlist": { "a": 1 }, "maskEntity": 66306, "firstwordmatch": "book", "details": { "0": { "1": { "labelword": "book", "inputwords": { "1": "book" }, "wordindex": [ 1 ], "foundexact": true, "bestwordindex": 1, "role": 2, "pos": 2200096997376, "tense": 8192, "ageLevel": 1, "commonness": 6 }, "2": { "labelword": "ticket", "inputwords": { "3": "ticket" }, "wordindex": [ 3 ], "foundexact": true, "bestwordindex": 3, "role": 8, "pos": 2147483680, "tense": 8192, "ageLevel": 1, "commonness": 5 } } }, "hasNoun": true, "hasVerb": true, "ageLevel": 1, "foundFmEngine": true, "scoreBreakdown": { "wordMatch": 500, "exactWords": 60, "coverage": 2000, "sentenceBonus": 4000, "positionBonus": 733.33, "orderBonus": 100, "spreadBonus": 800, "roleBonus": 2900, "faqQuestionBonus": 0, "mlMatchBonus": 0, "tasktypeBonus": 50, "matchBonus": 500, "phraseJoinPenalty": 0 }, "matchType": "definite", "task": "Book a ticket", "state": "published", "foundVia": "wordMatch" } ] }, "finalResolver": { "ranking": [ { "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "intent": "Book a ticket", "activityType": "dialog", "state": "published", "totalScore": 11643.33, "scoring": { "count": 2, "score": 11643.33, "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "botname": "Public APIs", "activity": "Book a ticket", "activityType": 1, "exactcount": 2, "labelsize": 2, "ignorewords": 1, "mask": 66306, "words": { "book": [ "0-1" ], "ticket": [ "0-3" ] }, "priority": 10, "tense": 8192, "mainRoles": 10, "sentencelength": 3, "ignorewordlist": { "a": 1 }, "maskEntity": 66306, "firstwordmatch": "book", "details": { "0": { "1": { "labelword": "book", "inputwords": { "1": "book" }, "wordindex": [ 1 ], "foundexact": true, "bestwordindex": 1, "role": 2, "pos": 2200096997376, "tense": 8192, "ageLevel": 1, "commonness": 6 }, "2": { "labelword": "ticket", "inputwords": { "3": "ticket" }, "wordindex": [ 3 ], "foundexact": true, "bestwordindex": 3, "role": 8, "pos": 2147483680, "tense": 8192, "ageLevel": 1, "commonness": 5 } } }, "hasNoun": true, "hasVerb": true, "ageLevel": 1, "foundFmEngine": true, "scoreBreakdown": { "wordMatch": 500, "exactWords": 60, "coverage": 2000, "sentenceBonus": 4000, "positionBonus": 733.33, "orderBonus": 100, "spreadBonus": 800, "roleBonus": 2900, "faqQuestionBonus": 0, "mlMatchBonus": 0, "tasktypeBonus": 50, "matchBonus": 500, "phraseJoinPenalty": 0 }, "matchType": "definite", "csMatch": true }, "identifyingEngines": { "fm": true }, "csMatch": true, "intentMatchVia": "wordMatch" } ], "userInput": "book a ticket", "winningIntent": [ { "intent": "Book a ticket", "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646", "activityType": "dialog", "state": "published", "score": 11643.33 } ], "entities": [] } }, "streamId": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb", "streamName": "Public APIs", "seqLogId": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5", "name": "Public APIs", "input": [ "book a ticket" ] }