Skip to content

About Question for Smartscan

Questions for Smartscan is a powerful API feature of Smartscan, designed to revolutionise the way businesses interact with their documents. It is a general-purpose question-answering system tailored specifically for business documents. This API will serve as a supplementary tool to Smartscan.

Demo

You can take this feature for a spin on our website. The demo application, or Document Chat prototype, showcases what this feature can do. Although the underlying technology might share similarities with ChatGPT - it serves as an information extractor (just like Smartscan), rather than a chatbot. You can upload documents and query your content, receiving answers about what is on the document based on what you ask for.

Questions

Our focus is on returning readable information directly from documents. While Questions for Smartscan is not a chatbot, users can ask human language questions about the content present in the document, like “what is the order number” or "what is the VAT amount". You cannot ask questions like "What is not on the document or "What is the weather?" as the example request below shows.

Get started with the API

The API is available both in our Staging environment and Production environment, and is free to use up to 5 questions and max 5 pages-long documents.

We have expanded our endpoint AnnotateDocument. In the API endpoint /v1/document:annotate, you can now define a list of questions to be processed, along with other requested features. This is shown in the example request below.

Example request


POST v1/document:annotate

https://api.stag.ssn.visma.ai/v1/document:annotate

Authorization - Bearer Token

Token: demo


Body - raw (json)

Body
{
    "document": {
        "source": {
            "httpUri": "http://classy.dk/ftest0716/IMG_20160720_111051.jpg"
        }
    },
    "features": [
        {"type": "TOTAL_VAT"},
        {"type":"RECEIVER_NAME"},
        {"type": "PURCHASE_LINES"},
        {"type": "PAGE_TEXTS"}

    ],
    "questions": [
        "How much is the VAT amount",
        "What is the weather?"
    ],
    "tier": "PREMIUM"
}


Upon querying the endpoint, the response will comprise a list of Answer Candidates, that will have up to 25 entries (five questions for a maximum of five pages).

Current limitations (alpha version):

  • You can ask up to five questions per document (asked of every page up to five pages).
  • We currently only support simple answers - text answers.

A single Answer Candidate contains:

  • The question that was asked and its corresponding answer. Note that the answer might not be there, if the document chat determines that the information is not present on the document. This is shown in the example below.
  • Page Reference
  • Confidence Level

Example response


Body - raw (json)

Body
{
    "feedbackId": "df7d8a8e-3332-40c1-bb97-aa981bcd0c4f",
    "answers": [
        {
            "question": "how much is the VAT amount",
            "answer": "1.250,00",
            "confidence": {
                "value": 0.734356344
            },
            "pageRef": 1
        },
        {
            "question": "What is the weather?",
            "confidence": {
                "value": 0.999989629
            },
            "pageRef": 1
        }
    ]
}


The combination of a question + page reference serves to backtrack what information was extracted and which page it was from.

You can then compare the confidences across the pages and find the most probable answer for the entire document. Alternatively, show the value for each individual page.

See the full API specification in vmlapis.