Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 765 Bytes

question-answering.md

File metadata and controls

30 lines (25 loc) · 765 Bytes
description
Retrieve the answer to a question from a given text

Question Answering

Question Answering models are designed to retrieve the answer to a question from a given text, which can be particularly useful for searching for information within a document. It's worth noting that some question answering models are capable of generating answers even without any contextual information.

SELECT pgml.transform(
    'question-answering',
    inputs => ARRAY[
        '{
            "question": "Where do I live?",
            "context": "My name is Merve and I live in İstanbul."
        }'
    ]
) AS answer;

Result

{
    "end"   :  39, 
    "score" :  0.9538117051124572, 
    "start" :  31, 
    "answer": "İstanbul"
}