QNA Maker 기술 자료에서 답변 가져오기

참고 항목

Azure Open AI On Your Data는 LLM(대규모 언어 모델)을 활용하여 QnA Maker와 유사한 결과를 생성합니다. QnA Maker 프로젝트를 Azure Open AI On Your Data로 마이그레이션하려면 가이드를 확인하세요.

참고 항목

QnA Maker 서비스가 2025년 3월 31일부로 종료됩니다. 이제 최신 버전의 질문 및 답변 기능이 Azure AI 언어의 일부로 사용할 수 있습니다. 언어 서비스 내의 질문 답변 기능은 질문 답변을 참조하세요. 2022년 10월 1일부터 새로운 QnA Maker 리소스를 만들 수 없습니다. 기존 QnA Maker 기술 자료를 질문 답변으로 마이그레이션하는 방법에 대한 정보는 마이그레이션 가이드를 참조하세요.

참고 항목

이 설명서는 최신 릴리스에는 적용되지 않습니다. 최신 질문 답변 API 사용에 대해 알아보려면 질문 답변 작성 가이드를 참조하세요.

이 cURL 기반 빠른 시작에서는 기술 자료에서 답변을 가져오는 과정을 안내합니다.

필수 조건

  • 다음이 있어야 합니다.
    • 최신 cURL
    • Azure 구독이 없는 경우 시작하기 전에 체험 계정을 만듭니다.
  • Azure Portal에서 만든 QnA Maker 리소스입니다. 리소스를 만들 때 선택한 Microsoft Entra ID, 구독, QnA 리소스 이름을 기억하세요.
  • 메타데이터 및 잡담으로 구성된 이전 빠른 시작의 질문과 대답이 포함된 학습 및 게시된 기술 자료

참고 항목

기술 자료에서 질문에 대한 대답을 생성할 준비가 되면 기술 자료를 학습게시해야 합니다. 기술 자료가 게시되면 게시 페이지에 대답을 생성하기 위한 HTTP 요청 설정이 표시됩니다. cURL 탭에는 명령줄 도구에서 대답을 생성하는 데 필요한 설정이 표시됩니다.

대답을 필터링하기 위한 메타데이터 사용

이전 빠른 시작의 기술 자료를 사용하여 메타데이터를 기반으로 하는 대답을 쿼리합니다.

  1. 기술 자료의 설정 페이지에서 CURL 탭을 선택하여 기술 자료에서 대답을 생성하는 데 사용되는 cURL 명령 예제를 확인합니다.

  2. 명령을 편집할 수 있도록 편집 가능한 환경(예: 텍스트 파일)으로 명령을 복사합니다. service:qna_maker의 메타데이터가 QnA 쌍에 대한 필터로 사용되도록 질문 값을 다음과 같이 편집합니다.

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'top':30, 'question':'size','strictFilters': [{'name':'service','value':'qna_maker'}]}"
    

    질문은 단일 단어(size)에 불과하며, 두 개의 QnA 쌍 중 하나를 반환할 수 있습니다. strictFilters 배열은 qna_maker 답변만 줄이도록 응답에 지시합니다.

  3. 응답에는 필터 조건을 충족하는 답변만 포함됩니다. 다음 cURL 응답은 읽기 쉬운 형식으로 지정되었습니다.

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 68.76,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "service",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null
    }
    

    검색어는 충족하지 않지만 필터는 충족하는 질문 및 답변 쌍이 있으면 반환되지 않습니다. 대신 일반 No good match found in KB. 답변이 반환됩니다.

디버그 쿼리 속성 사용

참고 항목

종속성에 디버그 속성을 사용하지 않는 것이 좋습니다. 이 속성은 제품 팀의 문제 해결을 돕기 위해 추가되었습니다.

디버그 정보를 사용하면 반환된 대답이 어떻게 결정되었는지 이해할 수 있습니다. 유용하지만 반드시 필요한 것은 아닙니다. 디버그 정보를 사용하여 대답을 생성하려면 debug 속성을 추가합니다.

Debug: {Enable:true}
  1. 추가 정보를 보려면 디버그 속성을 포함하도록 cURL 명령을 편집합니다.

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'Debug':{'Enable':true}}"
    
  2. 응답에는 대답에 대한 관련 정보가 포함됩니다. 다음 JSON 출력에서는 간단하게 하기 위해 일부 디버그 정보를 줄임표로 바꾸었습니다.

    {
        "answers": [
            {
                "questions": [
                    "How do I share a knowledge base with others?"
                ],
                "answer": "Sharing works at the level of a QnA Maker service, that is, all knowledge bases in the service will be shared.",
                "score": 56.07,
                "id": 5,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": {
            "userQuery": {
                "question": "How do I programmatically update my Knowledge Base?",
                "top": 1,
                "userId": null,
                "strictFilters": [],
                "isTest": false,
                "debug": {
                    "enable": true,
                    "recordL1SearchLatency": false,
                    "mockQnaL1Content": null
                },
                "rankerType": 0,
                "context": null,
                "qnaId": 0,
                "scoreThreshold": 0.0
            },
            "rankerInfo": {
                "specialFuzzyQuery": "how do i programmatically~6 update my knowledge base",
                "synonyms": "what s...",
                "rankerLanguage": "English",
                "rankerFileName": "https://qnamakerstore.blob.core.windows.net/qnamakerdata/rankers/ranker-English.ini",
                "rankersDirectory": "D:\\home\\site\\wwwroot\\Data\\QnAMaker\\rd0003ffa60fc45.24.0\\RankerData\\Rankers",
                "allQnAsfeatureValues": {
                    "WordnetSimilarity": {
                        "5": 0.54706300120043716,...
                    },
                    ...
                },
                "rankerVersion": "V2",
                "rankerModelType": "TreeEnsemble",
                "rankerType": 0,
                "indexResultsCount": 25,
                "reRankerResultsCount": 1
            },
            "runtimeVersion": "5.24.0",
            "indexDebugInfo": {
                "indexDefinition": {
                    "name": "064a4112-bd65-42e8-b01d-141c4c9cd09e",
                    "fields": [...
                    ],
                    "scoringProfiles": [],
                    "defaultScoringProfile": null,
                    "corsOptions": null,
                    "suggesters": [],
                    "analyzers": [],
                    "tokenizers": [],
                    "tokenFilters": [],
                    "charFilters": [],
                    "@odata.etag": "\"0x8D7A920EA5EE6FE\""
                },
                "qnaCount": 117,
                "parameters": {},
                "azureSearchResult": {
                    "continuationToken": null,
                    "@odata.count": null,
                    "@search.coverage": null,
                    "@search.facets": null,
                    "@search.nextPageParameters": null,
                    "value": [...],
                    "@odata.nextLink": null
                }
            },
            "l1SearchLatencyInMs": 0,
            "qnaL1Results": {...}
        },
        "activeLearningEnabled": true
    }
    

테스트 기술 자료 사용

테스트 기술 자료에서 대답을 가져오려면 isTest 본문 속성을 사용합니다.

속성은 부울 값입니다.

isTest:true

cURL 명령은 다음과 같습니다.

curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'IsTest':true}"

JSON 응답은 게시된 기술 자료 쿼리와 동일한 스키마를 사용합니다.

참고 항목

테스트 및 게시된 기술 자료가 정확히 동일한 경우 테스트 인덱스가 리소스의 모든 기술 자료에서 공유되기 때문에 약간의 변형이 있을 수 있습니다.

cURL을 사용하여 잡담 답변 쿼리

  1. cURL 지원 터미널에서 사용자의 봇 대화 종결 문구(예: Thank you)를 질문으로 사용합니다. 설정할 다른 속성이 없습니다.

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'thank you'}"
    
  2. cURL 명령을 실행하고 점수와 답변이 포함된 JSON 응답을 수신합니다.

    {
      "answers": [
          {
              "questions": [
                  "I thank you",
                  "Oh, thank you",
                  "My sincere thanks",
                  "My humblest thanks to you",
                  "Marvelous, thanks",
                  "Marvelous, thank you kindly",
                  "Marvelous, thank you",
                  "Many thanks to you",
                  "Many thanks",
                  "Kthx",
                  "I'm grateful, thanks",
                  "Ahh, thanks",
                  "I'm grateful for that, thank you",
                  "Perfecto, thanks",
                  "I appreciate you",
                  "I appreciate that",
                  "I appreciate it",
                  "I am very thankful for that",
                  "How kind, thank you",
                  "Great, thanks",
                  "Great, thank you",
                  "Gracias",
                  "Gotcha, thanks",
                  "Gotcha, thank you",
                  "Awesome thanks!",
                  "I'm grateful for that, thank you kindly",
                  "thank you pal",
                  "Wonderful, thank you!",
                  "Wonderful, thank you very much",
                  "Why thank you",
                  "Thx",
                  "Thnx",
                  "That's very kind",
                  "That's great, thanks",
                  "That is lovely, thanks",
                  "That is awesome, thanks!",
                  "Thanks bot",
                  "Thanks a lot",
                  "Okay, thanks!",
                  "Thank you so much",
                  "Perfect, thanks",
                  "Thank you my friend",
                  "Thank you kindly",
                  "Thank you for that",
                  "Thank you bot",
                  "Thank you",
                  "Right on, thanks very much",
                  "Right on, thanks a lot",
                  "Radical, thanks",
                  "Rad, thanks",
                  "Rad thank you",
                  "Wonderful, thanks!",
                  "Thanks"
              ],
              "answer": "You're welcome.",
              "score": 100.0,
              "id": 75,
              "source": "qna_chitchat_Professional.tsv",
              "metadata": [
                  {
                      "name": "editorial",
                      "value": "chitchat"
                  }
              ],
              "context": {
                  "isContextOnly": false,
                  "prompts": []
              }
          }
      ],
      "debugInfo": null,
      "activeLearningEnabled": true
    }
    

    Thank you의 질문은 잡담 질문과 정확히 일치하므로 QnA Maker는 신뢰도 점수 100으로, 완전히 신뢰할 수 있습니다. QnA Maker는 관련된 모든 질문과 잡담 메타데이터 태그 정보가 포함된 메타데이터 속성도 반환했습니다.

임계값 및 기본 대답 사용

대답에 대한 최소 임계값을 요청할 수 있습니다. 임계값이 충족되지 않으면 기본 대답이 반환됩니다.

  1. 임계값 80% 이상인 size에 대한 대답을 요청하려면 threshold 속성을 추가합니다. 질문의 점수가 71%이므로 기술 자료는 답변을 찾지 않습니다. 결과는 기술 자료를 만들 때 사용자가 제공한 기본 대답을 반환합니다.

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'scoreThreshold':80.00}"
    
  2. cURL 명령을 실행하고 JSON 응답을 수신합니다.

    {
        "answers": [
            {
                "questions": [],
                "answer": "No good match found in KB.",
                "score": 0.0,
                "id": -1,
                "source": null,
                "metadata": []
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

    QnA Maker가 신뢰가 없음을 의미하는 0의 점수를 반환했으며, 기본 응답도 반환했습니다.

  3. 임계값을 60%로 변경하고 쿼리를 다시 요청합니다.

    curl -X POST https://replace-with-your-resource-name.azurewebsites.net/qnamaker/knowledgebases/replace-with-your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey replace-with-your-endpoint-key" -H "Content-type: application/json" -d "{'question':'size', 'scoreThreshold':60.00}"
    

    반환된 JSON에서 대답을 찾았습니다.

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 71.1,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "server",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

비정형 데이터 원본 사용

이제 QnA를 추출하는 데 사용할 수 없는 구조화되지 않은 문서를 추가하는 기능을 지원합니다. 사용자는 쿼리에 대한 응답을 가져올 때 GenerateAnswer API에 구조화되지 않은 데이터 세트를 포함하거나 제외하도록 선택할 수 있습니다. Microsoft는 GA 서비스에서 비정형 데이터 세트를 지원하지 않으며, 이는 사용자 지정형 질문 답변에만 포함됩니다.

이 Postman 기반 빠른 시작에서는 기술 자료에서 답변을 가져오는 과정을 안내합니다.

필수 조건

  • 다음이 있어야 합니다.
  • Azure Portal에서 만든 QnA Maker 리소스입니다. 리소스를 만들 때 선택한 Microsoft Entra ID, 구독, QnA 리소스 이름을 기억하세요.
  • 메타데이터 및 잡담으로 구성된 이전 빠른 시작의 질문과 대답이 포함된 학습 및 게시된 기술 자료

참고 항목

기술 자료에서 질문에 대한 대답을 생성할 준비가 되면 기술 자료를 학습게시해야 합니다. 기술 자료가 게시되면 게시 페이지에 대답을 생성하기 위한 HTTP 요청 설정이 표시됩니다. Postman 탭에는 대답을 생성하는 데 필요한 설정이 표시됩니다.

요청을 위한 Postman 설정

이 빠른 시작은 Postman POST 요청에 대해 동일한 설정을 사용한 다음, 쿼리하려는 내용에 따라 서비스로 전송된 POST 본문 JSON으로 구성합니다.

다음 절차를 사용하여 Postman을 구성한 다음, 각 후속 섹션을 참조하여 POST 본문 JSON을 구성합니다.

  1. 기술 자료의 설정 페이지에서 Postman 탭을 선택하여 기술 자료에서 대답을 생성하는 데 사용되는 구성을 확인합니다. Postman에서 사용하는 다음 정보를 복사합니다.

    이름 설정 용도 및 값
    POST /knowledgebases/replace-with-your-knowledge-base-id/generateAnswer 이는 URL에 대한 HTTP 메서드 및 경로입니다.
    Host https://YOUR-RESOURCE_NAME.azurewebsites.net/qnamaker 이는 URL의 호스트입니다. 호스트 및 게시 값을 연결하여 전체 generateAnswer URL을 가져옵니다.
    Authorization EndpointKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Azure에 대한 요청을 권한 부여하는 헤더 값입니다.
    Content-type application/json 콘텐츠에 대한 헤더 값입니다.
    {"question":"<Your question>"} JSON 개체인 POST 요청의 본문입니다. 이 값은 쿼리의 용도에 따라 다음 각 섹션에서 변경됩니다.

    Important

    완료되면 코드에서 키를 제거하고 공개적으로 게시하지 마세요. 프로덕션의 경우 Azure Key Vault와 같은 자격 증명을 안전하게 저장하고 액세스하는 방법을 사용합니다. 자세한 내용은 Azure AI 서비스 보안 문서를 참조하세요.

  2. Postman을 열고 게시된 기술 자료 설정을 사용하여 새 기본 POST 요청을 만듭니다. 다음 섹션에서 POST 본문 JSON을 변경하여 쿼리를 기술 자료로 변경합니다.

대답을 필터링하기 위한 메타데이터 사용

이전 빠른 시작에서는 두 개의 서로 다른 질문을 구분하기 위해 두 개의 QnA 쌍에 메타데이터가 추가되었습니다. 쿼리에 메타데이터를 추가하여 관련 QnA 쌍으로만 필터를 제한합니다.

  1. Postman에서 service:qna_maker의 이름/값 쌍을 사용한 strictFilters 속성을 추가하여 쿼리 JSON만 변경합니다. 본문 JSON은 다음과 같아야 합니다.

    {
        'question':'size',
        'strictFilters': [
            {
                'name':'service','value':'qna_maker'
            }
        ]
    }
    

    질문은 한 단어(size)에 불과하며, 두 개의 질문 및 대답 쌍 중 하나를 반환할 수 있습니다. strictFilters 배열은 qna_maker 답변만 줄이도록 응답에 지시합니다.

  2. 응답에는 필터 조건을 충족하는 답변만 포함됩니다.

    다음 응답은 읽기 쉬운 형식으로 지정되었습니다.

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 68.76,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "service",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null
    }
    

    검색어는 충족하지 않지만 필터는 충족하는 질문 및 답변 쌍이 있으면 반환되지 않습니다. 대신 일반 No good match found in KB. 답변이 반환됩니다.

디버그 쿼리 속성 사용

참고 항목

종속성에 디버그 속성을 사용하지 않는 것이 좋습니다. 이 속성은 제품 팀의 문제 해결을 돕기 위해 추가되었습니다.

디버그 정보를 사용하면 반환된 대답이 어떻게 결정되었는지 이해할 수 있습니다. 유용하지만 반드시 필요한 것은 아닙니다. 디버그 정보를 사용하여 대답을 생성하려면 debug 속성을 추가합니다.

  1. Postman에서 debug 속성을 추가하여 본문 JSON만 변경합니다. JSON은 다음과 같아야 합니다.

    {
        'question':'size',
        'Debug': {
            'Enable':true
        }
    
    }
    
  2. 응답에는 대답에 대한 관련 정보가 포함됩니다. 다음 JSON 출력에서는 일부 디버그 정보를 줄임표로 바꾸었습니다.

    {
        "answers": [
            {
                "questions": [
                    "How do I share a knowledge base with others?"
                ],
                "answer": "Sharing works at the level of a QnA Maker service, that is, all knowledge bases in the service will be shared.",
                "score": 56.07,
                "id": 5,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": {
            "userQuery": {
                "question": "How do I programmatically update my Knowledge Base?",
                "top": 1,
                "userId": null,
                "strictFilters": [],
                "isTest": false,
                "debug": {
                    "enable": true,
                    "recordL1SearchLatency": false,
                    "mockQnaL1Content": null
                },
                "rankerType": 0,
                "context": null,
                "qnaId": 0,
                "scoreThreshold": 0.0
            },
            "rankerInfo": {
                "specialFuzzyQuery": "how do i programmatically~6 update my knowledge base",
                "synonyms": "what s...",
                "rankerLanguage": "English",
                "rankerFileName": "https://qnamakerstore.blob.core.windows.net/qnamakerdata/rankers/ranker-English.ini",
                "rankersDirectory": "D:\\home\\site\\wwwroot\\Data\\QnAMaker\\rd0003ffa60fc45.24.0\\RankerData\\Rankers",
                "allQnAsfeatureValues": {
                    "WordnetSimilarity": {
                        "5": 0.54706300120043716,...
                    },
                    ...
                },
                "rankerVersion": "V2",
                "rankerModelType": "TreeEnsemble",
                "rankerType": 0,
                "indexResultsCount": 25,
                "reRankerResultsCount": 1
            },
            "runtimeVersion": "5.24.0",
            "indexDebugInfo": {
                "indexDefinition": {
                    "name": "064a4112-bd65-42e8-b01d-141c4c9cd09e",
                    "fields": [...
                    ],
                    "scoringProfiles": [],
                    "defaultScoringProfile": null,
                    "corsOptions": null,
                    "suggesters": [],
                    "analyzers": [],
                    "tokenizers": [],
                    "tokenFilters": [],
                    "charFilters": [],
                    "@odata.etag": "\"0x8D7A920EA5EE6FE\""
                },
                "qnaCount": 117,
                "parameters": {},
                "azureSearchResult": {
                    "continuationToken": null,
                    "@odata.count": null,
                    "@search.coverage": null,
                    "@search.facets": null,
                    "@search.nextPageParameters": null,
                    "value": [...],
                    "@odata.nextLink": null
                }
            },
            "l1SearchLatencyInMs": 0,
            "qnaL1Results": {...}
        },
        "activeLearningEnabled": true
    }
    

테스트 기술 자료 사용

테스트 기술 자료에서 대답을 가져오려면 isTest 본문 속성을 사용합니다.

Postman에서 isTest 속성을 추가하여 본문 JSON만 변경합니다. JSON은 다음과 같아야 합니다.

{
    'question':'size',
    'isTest': true
}

JSON 응답은 게시된 기술 자료 쿼리와 동일한 스키마를 사용합니다.

참고 항목

테스트 및 게시된 기술 자료가 정확히 동일한 경우 테스트 인덱스가 리소스의 모든 기술 자료에서 공유되기 때문에 약간의 변형이 있을 수 있습니다.

잡담 대답을 위한 쿼리

  1. Postman에서 본문 JSON만 사용자의 대화 종료 문으로 변경합니다. JSON은 다음과 같아야 합니다.

    {
        'question':'thank you'
    }
    
  2. 응답에는 점수 및 대답이 포함됩니다.

    {
      "answers": [
          {
              "questions": [
                  "I thank you",
                  "Oh, thank you",
                  "My sincere thanks",
                  "My humblest thanks to you",
                  "Marvelous, thanks",
                  "Marvelous, thank you kindly",
                  "Marvelous, thank you",
                  "Many thanks to you",
                  "Many thanks",
                  "Kthx",
                  "I'm grateful, thanks",
                  "Ahh, thanks",
                  "I'm grateful for that, thank you",
                  "Perfecto, thanks",
                  "I appreciate you",
                  "I appreciate that",
                  "I appreciate it",
                  "I am very thankful for that",
                  "How kind, thank you",
                  "Great, thanks",
                  "Great, thank you",
                  "Gracias",
                  "Gotcha, thanks",
                  "Gotcha, thank you",
                  "Awesome thanks!",
                  "I'm grateful for that, thank you kindly",
                  "thank you pal",
                  "Wonderful, thank you!",
                  "Wonderful, thank you very much",
                  "Why thank you",
                  "Thx",
                  "Thnx",
                  "That's very kind",
                  "That's great, thanks",
                  "That is lovely, thanks",
                  "That is awesome, thanks!",
                  "Thanks bot",
                  "Thanks a lot",
                  "Okay, thanks!",
                  "Thank you so much",
                  "Perfect, thanks",
                  "Thank you my friend",
                  "Thank you kindly",
                  "Thank you for that",
                  "Thank you bot",
                  "Thank you",
                  "Right on, thanks very much",
                  "Right on, thanks a lot",
                  "Radical, thanks",
                  "Rad, thanks",
                  "Rad thank you",
                  "Wonderful, thanks!",
                  "Thanks"
              ],
              "answer": "You're welcome.",
              "score": 100.0,
              "id": 75,
              "source": "qna_chitchat_Professional.tsv",
              "metadata": [
                  {
                      "name": "editorial",
                      "value": "chitchat"
                  }
              ],
              "context": {
                  "isContextOnly": false,
                  "prompts": []
              }
          }
      ],
      "debugInfo": null,
      "activeLearningEnabled": true
    }
    

    Thank you의 질문은 잡담 질문과 정확히 일치하므로 QnA Maker는 신뢰도 점수 100으로, 완전히 신뢰할 수 있습니다. QnA Maker는 관련된 모든 질문과 잡담 메타데이터 태그 정보가 포함된 메타데이터 속성도 반환했습니다.

임계값 및 기본 대답 사용

대답에 대한 최소 임계값을 요청할 수 있습니다. 임계값이 충족되지 않으면 기본 대답이 반환됩니다.

  1. Postman에서 본문 JSON만 사용자의 대화 종료 문으로 변경합니다. JSON은 다음과 같아야 합니다.

    {
        'question':'size',
        'scoreThreshold':80.00
    }
    

    질문의 점수가 71%이므로 기술 자료는 답변을 찾지 않고, 기술 자료를 만들 때 사용자가 제공한 기본 대답을 반환해야 합니다.

    점수 및 대답을 포함한 반환된 JSON 응답은 다음과 같습니다.

    {
        "answers": [
            {
                "questions": [],
                "answer": "No good match found in KB.",
                "score": 0.0,
                "id": -1,
                "source": null,
                "metadata": []
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

    QnA Maker가 신뢰가 없음을 의미하는 0의 점수를 반환했으며, 기본 응답도 반환했습니다.

  2. 임계값을 60%로 변경하고 쿼리를 다시 요청합니다.

    {
        'question':'size',
        'scoreThreshold':60.00
    }
    

    반환된 JSON에서 대답을 찾았습니다.

    {
        "answers": [
            {
                "questions": [
                    "How large a knowledge base can I create?",
                    "What is the max size of a knowledge base?",
                    "How many GB of data can a knowledge base hold?"
                ],
                "answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.",
                "score": 71.1,
                "id": 3,
                "source": "https://learn.microsoft.com/azure/ai-services/qnamaker/troubleshooting",
                "metadata": [
                    {
                        "name": "link_in_answer",
                        "value": "true"
                    },
                    {
                        "name": "server",
                        "value": "qna_maker"
                    }
                ],
                "context": {
                    "isContextOnly": false,
                    "prompts": []
                }
            }
        ],
        "debugInfo": null,
        "activeLearningEnabled": true
    }
    

비정형 데이터 원본을 사용합니다.

이제 QnA를 추출하는 데 사용할 수 없는 구조화되지 않은 문서를 추가하는 기능을 지원합니다. 사용자는 쿼리에 대한 응답을 가져올 때 GenerateAnswer API에 구조화되지 않은 데이터 세트를 포함하거나 제외하도록 선택할 수 있습니다. GA 서비스에서는 비정형 데이터 세트를 지원하지 않습니다. 사용자 지정 질문 응답에서만 지원됩니다.

다음 단계

메타데이터에 대해 자세히 알아봅니다.