RecordWithAnswer

  • answer
    Type: object · Answer
    required

    The answer paragraph (i.e. a <p> node) whose text content can answer users' question.

    • css_selector
      Type: string · Css Selector
      required

      The CSS selector that uniquely identifies the answer paragraph node in the original HTML content. This css selector matches exactly one HTML node that contains the answer paragraph. In order to be as unambiguous as possible, the returned CSS selector is in the form of a series of nth-child selectors starting from :root node (which is usually the <html>). For example,

      :root > div:nth-child(1) > p:nth-child(2)
      

      . This selector means the answer paragraph is a <p> tag that is the second child of a <div> node, which is in turn, the first child of the :root node.

      This CSS selector is useful when you want to make the answer paragraph stand out from the rest of the document. For example, the following JQuery code turns the background color of the answer paragraph to yellow:

      $(answer.css_selector).css("background-color", "yellow");
      
    • probability
      Type: number · Probability
      min:  
      0
      max:  
      1
      required

      The probability this paragraph can sufficiently answer the user's question (from 0.0 to 1.0).

    • text
      Type: string · Text
      required

      The plain text version of answer paragraph.

    • html
      Type: string · Html

      The answer paragraph in its original html tag, i.e. or the outerHTML of the answer paragraph node.

  • product_id
    Type: string · Product Id
    max length:  
    512
    required

    The unique identifier of the product whose content contains the answer.

  • answer_block
    Type: object · Answer Block
        In addition to the answer paragraph, we also return the **answer block**.
        Answer block is the ancestor node of the answer paragraph that cover not only the answer, but also the relevant
        context. This is particularly useful for applications that want to show
        the answer itself but also the relevant context surrounding the answer.
    
        Answer block is the smallest HTML element that contains the relevant context. However, not all the content
        inside this node is relevant. You can use the `relevant_children_slice` to identify a portion inside this
        block that is relevant to the answer.
        
    
    • answer_css_selector
      Type: string · Answer Css Selector
      required
          The CSS selector to the selected answer paragraph inside the answer block. You can use this selector to select
          the answer from the answer block (as supposed to selecting from the HTML root)
          
      
    • css_selector
      Type: string · Css Selector
      required

      The CSS selector that uniquely identifies the answer block from the HTML root

    • html
      Type: string · Html
      required

      The HTML content of the answer block

    • relevant_children_slice
      Type: array · Relevant Children Slice
      required

      The range of children nodes inside the answer block that is relevant to the selected answer.

    • title
      Type: string · Title
      required

      The relevant title to the answer paragraph. This title is extracted from a header node close to the answer paragraph. If there is no such node, the title will be an empty string