의도 인식 결과와 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"
]
}