Question & Answer
Google has been very successful by surfacing snippets of content that can answer users' questions, directly from the search results page. Now any site can have this superpower with Miso.
Introduction
When users type certain questions into Google, like "What's a recipe for chocolate chip cookies?", they can get an answer directly on the search results page. This answer highlights a piece of content from elsewhere, without requiring the user to exit and go to another site. It's a strategy that's been very effective, helping users get information more quickly and keeping them engaged without leaving the Google search results page.
enable_question_answering
field to
true
when you upload your catalog of products/content.
Miso semantically analyzes and understands your content at a deep level and can also decipher the precise intent behind a user's question. The result is a highly powerful Q&A API that lets you mirror Google's functionality by answering users' questions with paragraphs extracted from the html
field for your products. For example, Miso can take a question like What is python?
, and extract an answer such as Python is an interpreted, object-oriented, high-level programming language.
The raw text that Miso generates answers against is derived from a product's html
field.
Before You Start
API Call / JSON Response
To fetch your Q&A answers, POST to the Q&A API with the following minimum parameters:
q
: The question user has entered.min_probability
: Miso assigns each answer aprobability
score (between 0.0 and 1.0) that determines how likely a paragraph can accurately answer the question. Answers that score lower thanmin_probability
will be excluded from the response. A probability at least 0.7 is recommended, but you usually will need to fine-tune this threshold to find the precision-and-recall sweet spot for your application.
The API will return a list of nested list of potential answers, ranked by their probability score.
html
field and from
products
that have
enable_question_answering
set to true.
Example API Call
POST /v1/qa/question_answering?api_key=<API_KEY>
{
"q": "what is gradient descent",
"min_probability": 0.90,
"rows": 5,
"fl": ["title", "authors"]
}
Example JSON Response
{
"message": "success",
"data": {
"took": 153,
"miso_id": "937c5d70-ddf7-11eb-832d-ba7ee8b57635",
"total": 38,
"spellcheck": {
"spelling_errors": false,
"auto_spelling_correction": false,
"original_query": "what is gradient descent",
"original_query_with_markups": "what is gradient descent",
"corrected_query": "what is gradient descent",
"corrected_query_with_markups": "what is gradient descent"
},
"answers": [
{
"product_id": "9781492037330_ch02.html",
"answer": {
"probability": 0.99267578125,
"text": "Gradient descent is a member of this path-finding class of algorithms. Variations of gradient descent exist, but ...",
"css_selector": ":root>section>div>section:nth-of-type(2)"
},
"title": "Fundamentals of Deep Networks",
"authors": [
"Adam Gibson",
"Josh Patterson"
]
}
...
]
}
}
Before You Launch
API Reference
Need more info on the API? Check out our dedicated API page with all the info you could ever want.
Read API Reference