קבלת סיכומי חיפוש (גרסה קודמת)

בדף הזה נסביר איך להשתמש ב-API כדי לקבל סיכומים של תוצאות החיפוש. בנוסף, מוסברות האפשרויות שזמינות עם סיכומי חיפוש. רק לנתונים לא מובנים ולנתונים מאתרים.

קבלת סיכום חיפוש

סיכום חיפוש הוא סיכום קצר של התוצאה הראשונה או של כמה מהתוצאות הראשונות שמוחזרות בתגובה לחיפוש. הסיכום עצמו נלקח מהתשובות החילוציות שמוחזרות בתגובה. לכן, כדי לקבל סיכום, צריך גם לקבל תשובות חילוץ עם תוצאות החיפוש. מידע נוסף זמין במאמר קבלת תשובות עם מידע חילוצי (גרסת Preview).

בתמונה הבאה מוצג הסיכום כשמבצעים שאילתה על קובצי PDF במאגר נתונים עם summaryResultCount שהוגדר כ-5. תוכן הסיכום יכול להשתנות בהתאם להגדרות האפליקציה.

סיכומי חיפוש יכולים לכלול טקסט בפורמט Markdown ותגי HTML פשוטים שמנתחי Markdown מבינים בדרך כלל. לכן, כדאי להשתמש במנתח Markdown באפליקציה כדי לעבד טקסט ב-Markdown.

כדי לקבל סיכום חיפוש, פועלים לפי השלבים הבאים:

  1. שולחים בקשת חיפוש שכוללת את contentSearchSpec.summarySpec ומציינת ערכים לפרמטרים summaryResultCount ו-maxExtractiveAnswerCount. מידע נוסף על שליחת בקשת חיפוש זמין במאמר תצוגה מקדימה של תוצאות חיפוש.

    בדוגמה הבאה, summarySpec מציין שאתם רוצים סיכום של החיפוש, ושהסיכום צריך להיווצר משלוש תוצאות החיפוש הראשונות.

    "contentSearchSpec":
     {
       "summarySpec":
       {
         "summaryResultCount": 3
       },
       "extractiveContentSpec": { "maxExtractiveAnswerCount" : 1}
     }
    
    • summaryResultCount: מספר התוצאות המובילות שמהן ייווצר סיכום החיפוש. אם מספר התוצאות שמוחזרות קטן מ-summaryResultCount, הסיכום נוצר מכל התוצאות.

    • maxExtractiveAnswerCount: מספר התשובות החילוציות שיוחזרו לכל תוצאת חיפוש. ערך ברירת המחדל הוא 0 והערך המקסימלי הוא 1.

  2. מקבלים את הסיכום מתשובת החיפוש. כל תגובה כוללת מאפיין summary אחד.

    הנה דוגמה לסיכום שמוחזר בסוף תשובת חיפוש:

    "summary":
    {
      "summaryText": "BigQuery is Google Cloud's fully managed and completely
      serverless enterprise data warehouse. BigQuery supports all data types,
      works across clouds, and has built-in machine learning and business
      intelligence, all within a unified platform."
    }
    

יצירת סיכומים מחלקים סמנטיים

אפשר להפעיל את use_semantic_chunks כדי ליצור סיכומים מהחלקים הרלוונטיים ביותר במסמך. שימוש בחלקים סמנטיים ליצירת סיכום מגדיל את ההיזכרות והאחזור בהשוואה להתנהגות ברירת המחדל של שימוש בתשובות חילוץ.

כשמפעילים את התכונה 'חלוקה סמנטית' לסיכומים, התגובה מחזירה את הסיכום ואת התוכן של כל מקטע שהסיכום התבסס עליו.

כדי להשתמש בחלקים סמנטיים ליצירת סיכום, צריך לבצע את השלבים הבאים:

  1. שולחים בקשת חיפוש שכוללת את contentSearchSpec.summarySpec ומציינים את "use_semantic_chunks": true. מידע נוסף על שליחת בקשת חיפוש זמין במאמר תצוגה מקדימה של תוצאות חיפוש.

    בדוגמה הבאה של summarySpec מצוין שרוצים סיכום חיפוש שמשתמש בחלקים סמנטיים, כמה תוצאות לכלול והאם לכלול ציטוטים.

    "contentSearchSpec":
     {
       "summarySpec":
       {
         "useSemanticChunks": SEMANTIC_CHUNK_BOOLEAN,
         "summaryResultCount": SUMMARY_RESULT_COUNT,
         "includeCitations": CITATIONS_BOOLEAN,
       }
     }
    
    • SEMANTIC_CHUNK_BOOLEAN: ערך בוליאני שמציין אם להשתמש בחלקים סמנטיים כדי ליצור את סיכום החיפוש. אם המדיניות מוגדרת כ-true, נעשה שימוש בחלקים סמנטיים.
    • SUMMARY_RESULT_COUNT: מספר התוצאות העליונות שמהן ייווצר סיכום החיפוש. הערך המקסימלי הוא 10.
    • CITATIONS_BOOLEAN: ערך בוליאני שמציין אם יוחזרו ציטוטים. אם הפעלתם את מצב החלוקה לקטעים כשנוצר מאגר הנתונים, ההפניות יהיו לקטעים. אחרת, הציטוטים מתייחסים למסמכי המקור. מידע נוסף על מצב חלוקה לחלקים זמין במאמר ניתוח מסמכים וחלוקה שלהם לחלקים.
  2. מקבלים את הסיכום מתשובת החיפוש.

    זוהי דוגמה לתשובה בחיפוש שכוללת סיכום שנוצר מחלקים וכוללת ציטוטים. החלק references בתשובה מכיל את התוכן של חלקי הטקסט שמהם נוצר הסיכום.

    תשובה

    {
      "results": [
        {
          "id": "123xyz",
          "document": {
            "name": "projects/exampleproject/locations/global/collections/default_collection/dataStores/exampledatastore/branches/0/documents/123xyz",
            "id": "123xyz",
            "derivedStructData": {
              "link": "gs://examplebucket/alphabet-investor-pdfs/2004_google_annual_report.pdf"
            }
          }
        }
      ],
      "totalSize": 8375,
      "attributionToken": "abcdefg",
      "nextPageToken": "hijklmnop",
      "guidedSearchResult": {},
      "summary": {
        "summaryText": "Google's search technology uses a combination of techniques to determine the importance of a web page independent of a particular search query and to determine the relevance of that page to a particular search query. [1]",
        "summaryWithMetadata": {
          "summary": "Google's search technology uses a combination of techniques to determine the importance of a web page independent of a particular search query and to determine the relevance of that page to a particular search query.",
          "citationMetadata": {
            "citations": [
              {
                "endIndex": "216",
                "sources": [
                  {}
                ]
              }
            ]
          },
          "references": [
            {
              "document": "projects/exampleproject/locations/global/collections/default_collection/dataStores/exampledatastore/branches/0/documents/123xyz",
              "chunkContents": [
                {
                  "content": "Groups contains more than 1 billion messages from Usenet Internet discussion groups dating back to 1981.The\ndiscussions in these groups cover a broad range of discourse and provide a comprehensive look at evolving\nviewpoints, debate and advice on many subjects.The new Google Groups adds in the ability to create your own\ngroups for you and your friends and an improved user interface.Google Mobile.Google Mobile offers people the ability to search and view both the "mobile web,"\nconsisting of pages created specifically for wireless devices, and the entire Google index of more than 8 billion\nweb pages.Google Mobile works on devices that support WAP, WAP 2.0, i-mode or j-sky mobile Internet\nprotocols.In addition, users can access a variety of information using Google SMS by typing a query to the\nGoogle shortcode.Google Mobile is available through many wireless and mobile phone services worldwide.",
                  "pageIdentifier": "17"
                },
                {
                  "content": "Google Labs is our playground for our engineers and for adventurous Google users.On Google\nLabs, we post product prototypes and solicit feedback on how the technology could be used or improved.Current Google Labs examples include:Google Personalized Search—provides customized search results based on an individual user's interests.Froogle Wireless—gives people the ability to search for product information from their mobile phones\nand other wireless devices.Google Maps—enables users to see maps, get directions, and find local businesses and services quickly\nand easily.Google Maps has several unique features, including draggable maps, integrated local search\nfrom Google Local, and keyboard shortcuts.Google Scholar—enables users to search specifically for scholarly literature, including peer-reviewed\npapers, theses, books, preprints, abstracts and technical reports from all broad areas of research.Google\nScholar can be used to find articles from a wide variety of academic publishers, professional societies,\npreprint repositories and universities, as well as scholarly articles available across the web.Google Suggest—guesses what you're typing and offers suggestions in real time.This is similar to\nGoogle's "Did you mean?"feature that offers alternative spellings for your query after you search, except\nthat it works in real time.",
                  "pageIdentifier": "17"
                },
                {
                  "content": "Groups contains more than 1 billion messages from Usenet Internet discussion groups dating back to 1981.The\ndiscussions in these groups cover a broad range of discourse and provide a comprehensive look at evolving\nviewpoints, debate and advice on many subjects.The new Google Groups adds in the ability to create your own\ngroups for you and your friends and an improved user interface.Google Mobile.Google Mobile offers people the ability to search and view both the "mobile web,"\nconsisting of pages created specifically for wireless devices, and the entire Google index of more than 8 billion\nweb pages.Google Mobile works on devices that support WAP, WAP 2.0, i-mode or j-sky mobile Internet\nprotocols.In addition, users can access a variety of information using Google SMS by typing a query to the\nGoogle shortcode.Google Mobile is available through many wireless and mobile phone services worldwide.\n\nGoogle Local.Google Local enables users to find relevant local businesses near a city, postal code, or specific\naddress.This service combines Yellow Page listings with information found on web pages, and plots their\nlocations on interactive maps.Google Print.Google Print brings information online that had previously not been available to web\nsearchers.Under this program, we enable a number of publishers to host their content and show their\npublications at the top of our search results.",
                  "pageIdentifier": "17"
                },
                {
                  "content": "Votes cast by important web pages with high PageRank weigh more heavily and are\nmore influential in deciding the PageRank of pages on the web.Text-Matching Techniques.Our technology employs text-matching techniques that compare search queries\nwith the content of web pages to help determine relevance.Our text-based scoring techniques do far more than\ncount the number of times a search term appears on a web page.For example, our technology determines the\nproximity of individual search terms to each other on a given web page, and prioritizes results that have the\nsearch terms near each other.Many other aspects of a page's content are factored into the equation, as is the\ncontent of pages that link to the page in question.By combining query independent measures such as PageRank\nwith our text-matching techniques, we are able to deliver search results that are relevant to what people are\ntrying to find.\n\nAdvertising Technology\nOur advertising program serves millions of relevant, targeted ads each day based on search terms people\n\nenter or content they view on the web.The key elements of our advertising technology include:\n\nGoogle AdWords Auction System.We use the Google AdWords auction system to enable advertisers to\nautomatically deliver relevant, targeted advertising.",
                  "pageIdentifier": "21"
                },
                {
                  "content": "Votes cast by important web pages with high PageRank weigh more heavily and are\nmore influential in deciding the PageRank of pages on the web.Text-Matching Techniques.Our technology employs text-matching techniques that compare search queries\nwith the content of web pages to help determine relevance.Our text-based scoring techniques do far more than\ncount the number of times a search term appears on a web page.For example, our technology determines the\nproximity of individual search terms to each other on a given web page, and prioritizes results that have the\nsearch terms near each other.Many other aspects of a page's content are factored into the equation, as is the\ncontent of pages that link to the page in question.By combining query independent measures such as PageRank\nwith our text-matching techniques, we are able to deliver search results that are relevant to what people are\ntrying to find.\n\nAdvertising Technology\nOur advertising program serves millions of relevant, targeted ads each day based on search terms people\n\nenter or content they view on the web.The key elements of our advertising technology include:",
                  "pageIdentifier": "21"
                },
                {
                  "content": "Google Maps—enables users to see maps, get directions, and find local businesses and services quickly\nand easily.Google Maps has several unique features, including draggable maps, integrated local search\nfrom Google Local, and keyboard shortcuts.Google Scholar—enables users to search specifically for scholarly literature, including peer-reviewed\npapers, theses, books, preprints, abstracts and technical reports from all broad areas of research.Google\nScholar can be used to find articles from a wide variety of academic publishers, professional societies,\npreprint repositories and universities, as well as scholarly articles available across the web.Google Suggest—guesses what you're typing and offers suggestions in real time.This is similar to\nGoogle's "Did you mean?"feature that offers alternative spellings for your query after you search, except\nthat it works in real time.Google Video—includes thousands of programs that play on our TVs every day.Google Video enables\nyou to search a growing archive of televised content—everything from sports to dinosaur\ndocumentaries to news shows.\n\n6",
                  "pageIdentifier": "17"
                },
                {
                  "content": "Every search query we process involves the automated\nexecution of an auction, resulting in our advertising system often processing hundreds of millions of auctions per\nday.To determine whether an ad is relevant to a particular query, this system weighs an advertiser's willingness\nto pay for prominence in the ad listings (the CPC) and interest from users in the ad as measured by the click\nthrough rate and other factors.If an ad does not attract user clicks, it moves to a less prominent position on the\npage, even if the advertiser offers to pay a high amount.This prevents advertisers with irrelevant ads from\n"squatting" in top positions to gain exposure.Conversely, more relevant, well-targeted ads that are clicked on\nfrequently move up in ranking, with no need for advertisers to increase their bids.Because we are paid only\nwhen users click on ads, the AdWords ranking system aligns our interests equally with those of our advertisers\nand our users.The more relevant and useful the ad, the better for our users, for our advertisers and for us.\n\nThe AdWords auction system also incorporates our AdWords discounter, which automatically lowers the\namount advertisers actually pay to the minimum needed to maintain their ad position.",
                  "pageIdentifier": "21"
                },
                {
                  "content": "Web Search Technology\nOur web search technology uses a combination of techniques to determine the importance of a web page\nindependent of a particular search query and to determine the relevance of that page to a particular search\nquery.We do not explain how we do ranking in great detail because some people try to manipulate our search\nresults for their own gain, rather than in an attempt to provide high-quality information to users.\n\nRanking Technology.One element of our technology for ranking web pages is called PageRank.While we\ndeveloped much of our ranking technology after Google was formed, PageRank was developed at Stanford\nUniversity with the involvement of our founders, and was therefore published as research.Most of our current\nranking technology is protected as trade-secret.PageRank is a query-independent technique for determining the\nimportance of web pages by looking at the link structure of the web.PageRank treats a link from web page A to\nweb page B as a "vote" by page A in favor of page B.The PageRank of a page is the sum of the PageRank of the\npages that link to it.The PageRank of a web page also depends on the importance (or PageRank) of the other\nweb pages casting the votes.",
                  "pageIdentifier": "21"
                },
                {
                  "content": "The Company recognizes as revenue the fees charged advertisers each time a user clicks on one of the text\nbased ads that are displayed next to the search results on Google web sites.Effective January 1, 2004, the\nCompany offered a single pricing structure to all of its advertisers based on the AdWords cost per click model.\n\nGoogle AdSense is the program through which the Company distributes its advertisers' text-based ads for\ndisplay on the web sites of the Google Network members.In accordance with Emerging Issues Task Force\n("EITF") Issue No. 99 19, Reporting Revenue Gross as a Principal Versus Net as an Agent, the Company recognizes\nas revenues the fees it receives from its advertisers.This revenue is reported gross primarily because the\nCompany is the primary obligor to its advertisers.\n\nThe Company generates fees from search services through a variety of contractual arrangements, which\ninclude per-query search fees and search service hosting fees.Revenues from set up and support fees and search\nservice hosting fees are recognized on a straight-line basis over the term of the contract, which is the expected\nperiod during which these services will be provided.The Company's policy is to recognize revenues from per\nquery search fees in the period queries are made and results are delivered.\n\nThe Company provides search services pursuant to certain AdSense agreements.",
                  "pageIdentifier": "85"
                },
                {
                  "content": "On Google Print pages, we provide links to book sellers that may\noffer the full versions of these publications for sale, and we show content-targeted ads that are served through\nthe Google AdSense program.Google Desktop Search.Google Desktop Search enables our users to perform a full text search on the\ncontents of their own computer, including email, files, instant messenger chats and web browser history.Users\ncan use this service to view web pages they have visited even when they are not online.Google Alerts.Google Alerts are email updates of the latest relevant Google results (web, news, etc.) based\non the user's choice of query or topic.Typical uses include monitoring a developing news story, keeping current\non a competitor or industry, getting the latest on a celebrity or event, or keeping tabs on a favorite sports team.Google Labs.Google Labs is our playground for our engineers and for adventurous Google users.On Google\nLabs, we post product prototypes and solicit feedback on how the technology could be used or improved.Current Google Labs examples include:Google Personalized Search—provides customized search results based on an individual user's interests.Froogle Wireless—gives people the ability to search for product information from their mobile phones\nand other wireless devices.",
                  "pageIdentifier": "17"
                }
              ]
            }
          ]
        }
      }
    }

קבלת ציטוטים

ההפניות, אם מצוינות, הן מספרים שמוצבים בשורה בסיכום החיפוש. המספרים האלה מציינים מאיזו תוצאת חיפוש נלקחו משפטים ספציפיים בסיכום.

כדי לקבל ציטוטים, פועלים לפי השלבים הבאים:

  1. שולחים בקשת חיפוש שכוללת את contentSearchSpec.summarySpec ומציינת את "includeCitations": true. מידע נוסף על שליחת בקשת חיפוש זמין במאמר תצוגה מקדימה של תוצאות חיפוש.

    בדוגמה הבאה, summarySpec מציין שרוצים סיכום של החיפוש, שהסיכום צריך להיווצר משלוש תוצאות החיפוש הראשונות, ושצריך לכלול בסיכום ציטוטים.

    "contentSearchSpec":
     {
       "summarySpec":
       {
         "summaryResultCount": 3,
         "includeCitations": true
       },
       "extractiveContentSpec": { "maxExtractiveAnswerCount" : 1}
     }
    
    • summaryResultCount: מספר התוצאות המובילות שמהן ייווצר סיכום החיפוש. אם מספר התוצאות שמוחזרות קטן מ-summaryResultCount, הסיכום נוצר מכל התוצאות. הערך המקסימלי הוא 5.
    • includeCitations: ערך בוליאני שקובע אם יוחזרו ציטוטים.
    • maxExtractiveAnswerCount: מספר התשובות החילוציות שיוחזרו לכל תוצאת חיפוש. ערך ברירת המחדל הוא 0 והערך המקסימלי הוא 1.
  2. מקבלים את הסיכום עם ציטוטים מהתשובה בחיפוש. כל תגובה מחזירה נכס אחד summary

    הנה דוגמה לסיכום, עם ציטוטים ביבליוגרפיים ומטא-נתונים של ציטוטים, שמוחזר בסוף תשובת החיפוש:

    "summary": {
     "summaryText": "BigQuery is Google Cloud's fully managed and completely
      serverless enterprise data warehouse [1]. BigQuery supports all data types,
      works across clouds, and has built-in machine learning and business
      intelligence, all within a unified platform [2, 3].",
     "summaryWithMetadata": {
       "summary": "BigQuery is Google Cloud's fully managed and completely
       serverless enterprise data warehouse. BigQuery supports all data types,
       works across clouds, and has built-in machine learning and business
       intelligence, all within a unified platform.",
       "citationMetadata": {
         "citations": [
           {
             "startIndex": "0",
             "endIndex": "101",
             "sources": [
               {
                 "uri": "gs://example-dataset/html/6344007140738632642.html",
                 "title": "About BigQuery",
                 "id": "b6344007140738632642",
                 "referenceIndex": "0"
               },
               {
                 "uri": "gs://example-dataset/html/1365490014946172719.html",
                 "title": "Google Cloud article",
                 "id": "b1365490014946172719",
                 "referenceIndex": "1"
               },
               {
                 "uri": "gs://example-dataset/html/2687910668117268120.html",
                 "title": "BigQuery document",
                 "id": "a2687910668117268120",
                 "referenceIndex": "2"
               }
             ]
           },
           {
             "startIndex": "103",
             "endIndex": "230",
             "sources": [
               {
                 "referenceIndex": "0"
                },
               {
                 "referenceIndex": "1"
               },
               {
                 "referenceIndex": "2",
               }
             ]
           }
         ]
       },
       "references": [
       {
         "title": "Sports in the United States",
         "docName": "projects/123/locations/global/collections/default_collection/dataStores/ds-123/branches/0/documents/b6344007140738632642",
         "uri": "https://example.com/bigqueryA"
       },
       {
         "title": "Sports in the United States",
         "docName": "projects/123/locations/global/collections/default_collection/dataStores/ds-123/branches/0/documents/b1365490014946172719",
         "uri": "https://example.com/bigqueryB"
       },
       {
         "title": "Sports in the United States",
         "docName": "projects/123/locations/global/collections/default_collection/dataStores/ds-123/branches/0/documents/a268791066811726812",
         "uri": "https://example.com/bigqueryC"
       }
     ]
    }
    }
    
    • summaryText: סיכום החיפוש, עם מספרי ציטוטים. מספרי הציטוטים מתייחסים לתוצאות החיפוש שהוחזרו, והם מבוססים על אינדקס שמתחיל ב-1. לדוגמה, [1] אומר שהמשפט משויך לתוצאת החיפוש הראשונה. ‫[2, 3] מציין שהמשפט משויך גם לתוצאת החיפוש השנייה וגם לתוצאת החיפוש השלישית.
    • citations: לכל משפט בסיכום שיש לו ציטוט, מוצגים המטא-נתונים של הציטוט.
    • startIndex: מציין את תחילת המשפט, שנמדדת בבייטים של Unicode.
    • endIndex: מציין את סוף המשפט, שנמדד בבייטים של Unicode.
    • sources: רשימה של referenceIndex לכל מקור שנכלל בציטוט של המשפט. ‫referenceIndex הוא מספר האינדקס שהוקצה למקור. ההפניה למקור הראשון referenceIndex לא תמיד מופיעה באופן מפורש בתשובה. מכיוון שהאינדקס של referenceIndex הוא 0, המקור הראשון תמיד מקבל את הערך 0.referenceIndex
    • references: רשימת המטא-נתונים של כל הפניות שצוטטו בסיכום. המטא-נתונים כוללים את title,‏ docName ו-uri.

התעלמות משאילתות מתנגדות

שאילתות עוינות כוללות תגובות שליליות או שהן מיועדות ליצירת פלט לא בטוח שמפר את כללי המדיניות. אתם יכולים לציין שלא יוחזרו סיכומי חיפוש לשאילתות שנועדו להטעות. כשמתעלמים משאילתה עוינת, המאפיין summaryText מכיל טקסט סטנדרטי שמציין שלא הוחזר סיכום חיפוש. מסמכי חיפוש מוחזרים לשאילתות מתנגדות, גם אם סיכומי החיפוש לא מוחזרים.

כדי לציין שלא יוחזרו סיכומים של חיפושים עבור שאילתות שנועדו להטעות את המודל, פועלים לפי השלבים הבאים:

  1. שולחים בקשת חיפוש שכוללת את contentSearchSpec.summarySpec ומציינת את "ignoreAdversarialQuery": true. מידע נוסף על שליחת בקשת חיפוש זמין במאמר תצוגה מקדימה של תוצאות חיפוש.

    בדוגמה הבאה, summarySpec מציין שרוצים סיכום של החיפוש, שהסיכום צריך להיווצר משלוש התוצאות הראשונות של החיפוש, אבל שלא יוחזר סיכום לשאילתות עם כוונות זדוניות.

    "contentSearchSpec":
     {
       "summarySpec":
       {
         "summaryResultCount": 3,
         "ignoreAdversarialQuery": true
       },
       "extractiveContentSpec": { "maxExtractiveAnswerCount" : 1}
     }
    
    • summaryResultCount: מספר התוצאות המובילות שמהן ייווצר סיכום החיפוש. אם מספר התוצאות שמוחזרות קטן מ-summaryResultCount, הסיכום נוצר מכל התוצאות. הערך המקסימלי הוא 5.
    • ignoreAdversarialQuery: ערך בוליאני שמציין שלא יוחזרו סיכומים של חיפושים לשאילתות שנועדו להטעות.
    • maxExtractiveAnswerCount: מספר התשובות החילוציות שיוחזרו לכל תוצאת חיפוש. ערך ברירת המחדל הוא 0 והערך המקסימלי הוא 1.
  2. אפשר לראות את המאפיין summary שמוחזר לבקשת חיפוש יריב.

    לדוגמה:

    "summary":
    {
      "summaryText": "We do not have a summary for your query. Here are some
      search results.",
      "summarySkippedReasons": [
       "ADVERSARIAL_QUERY_IGNORED"
     ]
    }
    
    • summaryText: טקסט סטנדרטי שמציין שלא הוחזר סיכום חיפוש.
    • summarySkippedReasons: ספירה עם ערכים של סיבות לדילוג על סיכום.

התעלמות משאילתות שלא קשורות לסיכום

שאילתות שלא מחפשות סיכום מחזירות תוצאות שלא מתאימות לסיכום. לדוגמה, השאילתות 'למה השמיים כחולים' ו'מי הוא שחקן הכדורגל הכי טוב בעולם?' הן שאילתות שמטרתן לקבל סיכום, אבל השאילתות 'שדה התעופה SFO' ו'מונדיאל 2026' לא. בדרך כלל אלה שאילתות ניווט. אתם יכולים לציין שלא יוחזרו סיכומי חיפוש לשאילתות שלא מחפשות סיכומים. מסמכי חיפוש מוחזרים לשאילתות שלא מחפשות סיכום, אבל סיכומי חיפוש לא מוחזרים.

כדי לציין שלא יוחזרו סיכומים של חיפושים לשאילתות שלא מחפשות סיכום, פועלים לפי השלבים הבאים:

  1. שולחים בקשת חיפוש שכוללת את contentSearchSpec.summarySpec ומציינת את "ignoreNonSummarySeekingQuery": true. מידע נוסף על שליחת בקשת חיפוש זמין במאמר תצוגה מקדימה של תוצאות חיפוש.

    בדוגמה הבאה, summarySpec מציין שרוצים סיכום של החיפוש, שהסיכום צריך להיווצר משלוש תוצאות החיפוש הראשונות, אבל שלא יוחזר סיכום לשאילתות שלא מחפשות סיכום.

    "contentSearchSpec":
     {
       "summarySpec":
       {
         "summaryResultCount": 3,
         "ignoreNonSummarySeekingQuery": true
       },
       "extractiveContentSpec": { "maxExtractiveAnswerCount" : 1}
     }
    
    • summaryResultCount: מספר התוצאות המובילות שמהן ייווצר סיכום החיפוש. אם מספר התוצאות שמוחזרות קטן מ-summaryResultCount, הסיכום נוצר מכל התוצאות. הערך המקסימלי הוא 5.
    • ignoreNonSummarySeekingQuery: ערך בוליאני שמציין שלא יוחזרו סיכומי חיפוש לשאילתות שלא מחפשות סיכומים.
    • maxExtractiveAnswerCount: מספר התשובות החילוציות שיוחזרו לכל תוצאת חיפוש. ערך ברירת המחדל הוא 0 והערך המקסימלי הוא 1.
  2. אפשר לראות את המאפיין summary שמוחזר עבור בקשת חיפוש שלא מחפשת סיכום.

    לדוגמה:

    "summary":
    {
      "summaryText": "We do not have a summary for your query. Here are some
      search results.",
      "summarySkippedReasons": [
        "NON_SUMMARY_SEEKING_QUERY_IGNORED"
     ]
    }
    
    • summaryText: טקסט סטנדרטי שמציין שלא הוחזר סיכום חיפוש.
    • summarySkippedReasons: ספירה עם ערכים של סיבות לדילוג על סיכום.

קבלת סיכומים בהתאמה אישית

אתם יכולים לקבל סיכומים בהתאמה אישית על ידי מתן הוראות בשפה טבעית. התכונה הזו זמינה בווידג'ט החיפוש באמצעות המסוף, וב-API באמצעות הזנת הוראות בשדה modelPromptSpec.preamble.

אתם יכולים לבקש התאמות אישיות כמו אורך, רמת פירוט, סגנון פלט (למשל, "פשוט"), שפת פלט, מוקד התשובה ופורמט (למשל, טבלאות, תבליטים ו-XML).

לדוגמה, בשאילתה What are the benefits of bigquery?, אפשר להזין הוראות להתאמה אישית כמו בדוגמאות הבאות:

  • הוראה לדוגמה: please show the answer format in an ordered list

    דוגמה לתשובה:

    The benefits of BigQuery are:
    
    1. Increased business productivity
    2. IT staff productivity
    3. Reduced infrastructure costs
    4. Loading and exporting data are free
    
  • הוראה לדוגמה: give a very detailed answer

    דוגמה לתשובה:

    BigQuery is a serverless, highly scalable, and cost-effective cloud data warehouse that enables businesses to analyze all their data very quickly. It is a fully managed service that takes care of provisioning, scaling, and managing the underlying infrastructure, so you can focus on analyzing your data. BigQuery is also integrated with other Google Cloud services, such as Google Kubernetes Engine, Cloud Data Fusion, and Cloud Dataproc, making it easy to build and deploy data pipelines.
    
    Here are some of the benefits of using BigQuery:
    
    * **Fast and scalable:** BigQuery can process petabytes of data very quickly, and it can scale to handle even the most demanding workloads. * **Cost-effective:** BigQuery is a very cost-effective way to store and analyze data. You only pay for the data that you use, and there are no upfront costs or commitments. * **Secure:** BigQuery is a secure platform that meets the needs of even the most security-conscious organizations. * **Easy to use:** BigQuery is easy to use, even for non-technical users. It has a simple and intuitive user interface, and it supports a variety of data sources. * **Integrated with other Google Cloud services:** BigQuery is integrated with other Google Cloud services, making it easy to build and deploy data pipelines.
    
    If you are looking for a fast, scalable, and cost-effective way to analyze your data, then BigQuery is a great option.
    

שיטות מומלצות לשימוש בסיכומים מותאמים אישית

אם אתם מתכננים להשתמש בתכונה הזו, אתם צריכים:

  • אפשר לבקש רק התאמה אישית אחת בכל פעם. לא כדאי לשלב התאמות אישיות – למשל, לבקש טבלת HTML בצרפתית.
  • ‫Google ממליצה להגביל את ההתאמות האישיות שמשתמשי הקצה יכולים לבקש – למשל, להציע כלי לבחירת התאמות אישיות מתוך קבוצה של התאמות אישיות מוגדרות מראש.

התאמה אישית של הסיכומים

אפשר לקבל סיכומים בהתאמה אישית רק לווידג'ט החיפוש באמצעות המסוף, או לכל בקשת חיפוש באמצעות ה-API.

כדי לקבל סיכום מותאם אישית:

המסוף

  1. נכנסים לדף Gemini Enterprise במסוף Google Cloud .

    Gemini Enterprise

  2. לוחצים על שם האפליקציה שרוצים לערוך.

  3. עוברים אל Configurations (הגדרות) > UI (ממשק משתמש).

  4. מוודאים שסוג החיפוש בווידג'ט החיפוש מוגדר לחיפוש עם תשובה או לחיפוש עם שאלות המשך. התכונה הזו לא זמינה אם בוחרים באפשרות חיפוש.

  5. מפעילים את האפשרות הפעלת התאמה אישית של הסיכום.

  6. כדי להזין הוראות לסיכום, מבצעים אחת מהפעולות הבאות:

    • מזינים הוראות חופשיות: מזינים הוראות בשפה טבעית בשדה הקדמה.
    • שימוש בהוראות של תבנית: לוחצים על החלפה בתבנית ובוחרים אחת מההוראות המוגדרות מראש של התבנית. אחרי שבוחרים בתבנית המוגדרת מראש, היא מופיעה בשדה מבוא.
  7. כדי לבדוק את יצירת הסיכום המותאם אישית לאפליקציה, מחפשים בחלונית תצוגה מקדימה.

  8. כדי לאפס את ההוראות לסט האחרון שנשמר, לוחצים על Reset preamble (איפוס ההקדמה).

  9. כדי לשמור את ההגדרות בווידג'ט, לוחצים על שמירה ופרסום.

REST

  1. שולחים בקשת חיפוש שכוללת את contentSearchSpec.summarySpec ומציינת את הוראות ההתאמה האישית ב-modelPromptSpec.preamble. מידע נוסף על שליחת בקשת חיפוש זמין במאמר בנושא תצוגה מקדימה של תוצאות חיפוש.

    בדוגמה הבאה, summarySpec מציין שאתם רוצים סיכום של תוצאות החיפוש, שהסיכום ייווצר משלוש תוצאות החיפוש הראשונות, ושהסיכום יהיה מותאם אישית כאילו הוא מוסבר לילד בן 10.

    "contentSearchSpec":
      {
        "summarySpec":
        {
          "summaryResultCount": 3,
          "modelPromptSpec":
          {
            "preamble": "explain like you would to a ten year old"
          }
        }
      }
    
    • summaryResultCount: מספר התוצאות המובילות שמהן ייווצר סיכום החיפוש. אם מספר התוצאות שמוחזרות קטן מ-summaryResultCount, הסיכום נוצר מכל התוצאות. הערך המקסימלי הוא 5.
    • preamble: ההוראה להתאמה אישית.
  2. קבלת סיכום בהתאמה אישית מתשובת החיפוש.

    זוהי דוגמה לסיכום מותאם אישית שמוחזר:

    "summary":
    {
      "summaryText": "BigQuery is a serverless data warehouse that helps you
      analyze all your data very quickly. It's very easy to use and you don't
      need to worry about managing servers or infrastructure. BigQuery is also
      very scalable, so you can analyze large datasets without any problems."
    }
    
    • summaryText: סיכום החיפוש המותאם אישית.

ציון מודל הסיכום

אתם יכולים להגדיר את המודל שבו אתם רוצים להשתמש כדי ליצור סיכומים.

אפשר לציין את stable, את preview או גרסה ספציפית של מודל לפי שם. במאמר גרסאות ושלבי מחזור החיים של מודלים ליצירת תשובות מפורטות גרסאות המודלים שזמינות.

כדי לשנות את גרסת המודל:

  1. שולחים בקשת חיפוש שכוללת את ContentSearchSpec.SummarySpec.ModelSpec כדי לציין את גרסת המודל.

    "contentSearchSpec": {
      "summarySpec": {
        "modelSpec": {
          "version": "MODEL_VERSION"
         }
       }
     }
    
    • MODEL_VERSION: מציין באיזה מודל להשתמש כדי ליצור סיכומים. הערכים הנתמכים הם:

      • stable: מחרוזת. הגדרה שמוגדרת כברירת מחדל אם לא מציינים ערך. ‫stable מציין גרסת מודל של GA שעברה כוונון עדין ליצירת תשובות. המודל שאליו stable מפנה משתנה כשגרסאות חדשות של מודלים של GA מתפרסמות וגרסאות קודמות של מודלים יוצאות משימוש. כדי לראות את הגרסה העדכנית שאליה stable מפנה המאמר הזה, אפשר לעיין במאמר גרסאות של מודלים ליצירת תשובות ומחזור החיים שלהם.
      • preview: מחרוזת. ‫preview מצביע על המודל העדכני ביותר של Gemini למענה על שאלות. מידע נוסף על Gemini זמין במאמר סקירה כללית של מודלים.
      • כדי לציין גרסה מסוימת של המודל, מזינים את שם הגרסה, למשל gemini-1.5-flash-002/answer_gen/v1. לגרסאות הנתמכות, אפשר לעיין במאמר גרסאות של מודלים ליצירת תשובות ומחזור החיים שלהן.

לדוגמה, בבקשת החיפוש הבאה מצוין preview כגרסת המודל:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/exampleproject/locations/global/collections/default_collection/dataStores/exampledatastore/servingConfigs/default_search:search" \
-d '{
  "query": "what is bigquery",
  "contentSearchSpec": {
    "summarySpec": {
      "modelSpec": {
        "version": "preview"
      }
    }
  }
}'

מגבלות של סיכומי חיפוש

יכול להיות שתיתקלו במגבלות הבאות כשמשתמשים בסיכומי חיפוש:

  • מכיוון שמודלים גדולים של שפה (LLM) משמשים ליצירת סיכומים וציטוטים בחיפוש, המגבלות של מודלים גדולים של שפה חלות גם על סיכומים ב-Gemini Enterprise.

    מידע כללי על המגבלות האלה של מודלי LLM זמין במאמר מגבלות של מודלים במסמכי התיעוד של Vertex AI.

  • שאילתות חיפוש שמצריכות חשיבה רציונלית או אנליטית מורכבת, או הבנה של העולם, עלולות להוביל לסיכומי חיפוש שמכילים מידע שגוי (הזיות) או מידע שלא מופיע בנתונים הלא מובנים או בנתוני האתר.

  • יכול להיות שחלק מההצהרות בסיכום החיפוש לא יכללו ציטוט:

    • אם המערכת קובעת שלא נדרש ביסוס של טענה, היא לא תכלול ציטוט. במשפטים כמו "הנה מה שמצאתי" או "יש הרבה שיטות שאפשר לפעול לפיהן" אין ציטוטים.

    • ציטוטים חסרים יכולים גם להצביע על כך שלא נמצא מקור תקף. יכול להיות שעובדות ללא ציטוטים לא יהיו מהימנות.

  • במקרים נדירים, יכול להיות שציטוטים ישויכו בטעות לטענה.

  • יכול להיות שמסמכים מורכבים ינותחו בצורה שגויה על ידי ה-LLM. במקרה כזה, יכול להיות שהסיכום יהיה חלקי או לא נכון.

  • ההוראות להתאמה אישית הן בשפה טבעית, ולכן אי אפשר להבטיח שהמערכת תפעל לפי ההוראות בכל הבקשות.