AIを活用した質問と回答の取得

日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Sitecore SearchのSearchと推奨事項APIを使用して、訪問者のクエリに基づいてAIを活用した質問と回答を取得できます。

大事な

関連する質問と回答を生成するAIの能力は、渡すソースで インデックス付けされた項目 に直接依存します。インデックスされたコンテンツが訪問者のクエリと一致しない場合、AIは関連する応答を提供しません。たとえば、訪問者がWho is the CEO of Sitecore? を検索しても、ソースが児童書のみにインデックスを付けている場合、結果は得られません。

questions オブジェクトを使用する必要があります。このオブジェクトのデータモデルについては、Searchおよび推奨APIリファレンスドキュメントsearch.widget.items.questions

questionsオブジェクトには、いくつかのパラメータがあります。渡すパラメータに応じて、関連する質問と回答のセット、または1つの正確な回答の2種類の結果を取得できます。

関連する質問の取得

questions.related_questionsパラメーターを使用すると、訪問者の検索語に関連するAIを活用した質問と回答のペアを取得できます。たとえば、これらの質問と回答を使用して、people also askedまたはfrequently askedセクションに入力できます。

関連する質問と回答を取得するための簡単なクエリ

これは、キーフレーズに基づいて関連する質問と回答を取得する簡単な例です。

この例では、訪問者がキーフレーズcontent hubを入力し、関連する5つの質問を表示します。

リクエストの例を次に示します。

{ 
  "widget": {
    "items": [
      { 
        "entity": "content",
        "rfk_id": "rfkid_qa",
        "questions": {
          "keyphrase": "content hub?",
          "related_questions": {
            "limit": 5
          }        
        }
      }
    ]
  }
}

この要求に対する次の応答例では、AIが生成した質問のWhat is content hub?How can I integrate with content hub?、および対応する回答を確認できます。

{ 
  "dt": 1649558400, 
  "errors": [], 
  "ts": 1649558400, 
  "widgets": [ 
    { 
      "entity": "content",
      "errors": [], 
      "facet": [], 
      "limit": 5, 
      "offset": 0, 
      "related_questions": [ 
        { 
          "answer": "Sitecore Content Hub is a comprehensive digital asset management system that you can use to handle a wide array of marketing content 			and assets efficiently. It offers a suite of tools for managing digital assets, content, products, and brands, as well as for 			creating publication templates and integrating with external applications.", 
          "context": "Sitecore Content Hub is a digital management application that provides you with a variety of features centered around digital assets 		and marketing content...", 
          "document_id": "doc123", 
          "extra_fields": {}, 
          "highlight": "Content Hub", 
          "id": "qa123", 
          "question": "What is content hub?", 
          "type": "FAQ" 
        }, 
        { 
          "answer": "You can perform internal and external integration with Sitecore Content Hub. You can use scripts, triggers APIs, and SDKs to integrate.", 
          "context": "Sitecore Content Hub integrates internal features that add greater flexibility and advanced customization. This section explains how to use custom scripts....This section explains how to use Sitecore Content Hub to integrate third-party APIs and SDKs to improve developer usability....", 
          "document_id": "doc124", 
          "extra_fields": {}, 
          "highlight": "Content Hub integration", 
          "id": "qa124", 
          "question": "How can I integrate with Content Hub?", 
          "type": "FAQ" 
        } 
        // ... 3 more related questions 
      ], 
      "rfk_id": "rfkid_qa", 
      "total_item": 5, 
      "type": "Questions Widget", 
      "used_in": "Search Page" 
    } 
  ] 

正確な答えを得る

questions.exact_answerオブジェクトを使用すると、訪問者が入力した質問や語句に対する正確な回答を取得できます。たとえば、検索バーのすぐ下に回答を表示できます。

この例では、訪問者クエリー Mount Everest heightに対する正確な回答を提供します。

リクエストの例を次に示します。

{
  "widget": {
    "items": [
      {
        "rfk_id": "rfkid_qa", 
        "entity": "content",
        "questions": {
          "keyphrase": "mount everest height",
          "exact_answer": {
            "query_types": ["statement"]
          }
        }
      }
    ]
  }
}

この要求に対する応答の例を次に示します。

{
  "dt": 1649558400,
  "errors": [],
  "ts": 1649558400,
  "widgets": [
    {
      "entity": "content",
      "errors": [],
      "facet": [],
      "limit": 1,
      "offset": 0,
      "related_questions": [
        {
          "answer": "8,848.86 meters (29,031.7 feet) above sea level.",
          "context": "The height of Mount Everest has been a subject of some variation over the years, with the most recent survey in 2020 establishing its height at 8,848.86 meters. This makes it the tallest mountain above sea level...",
          "document_id": "docEverest123",
          "extra_fields": {},
          "highlight": "Mount Everest height",
          "id": "qaEverestHeight",
          "question": "What is the height of Mount Everest?",
          "type": "FAQ"
        }
      ],
      "rfk_id": "rfkid_qa",
      "total_item": 1,
      "type": "Questions Widget",
      "used_in": "Search Page"
    }
  ]
}
先端

関連する質問と回答、および正確な回答を一緒に取得するには、同じリクエストでquestions.related_questionsquestions.exact_answerを渡します。応答を使用して、検索バーとpeople also askedセクションの両方に正確な回答を表示できます。

この記事を改善するための提案がある場合は、 お知らせください!