> ## Documentation Index
> Fetch the complete documentation index at: https://docs.somark.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docision

> Ask multiple questions about the same document image and let Docision choose from the answers you define.

**Docision** is an open-source tool for multimodal document decisions. It uses the text, tables, layout, and visual elements on a page to choose from the answers you provide. You can use it to classify documents, check information, and route records through a workflow.

For an invoice review, use one request to classify the document, check for a stamp, and decide whether to archive it, request missing information, or send it for review under your rules.

> [card] [GitHub repository](https://github.com/SoMarkAI/docision/blob/main/README.md)
>
> View the README, source code, and examples.

> [card] [Docision-1.0 model](https://huggingface.co/SoMarkAI/Docision-1.0)
>
> View and download the model weights on Hugging Face.

## Quickstart

This example requires Python 3.10 or later and uses CUDA GPU `0`. Download the model and run inference with the input included in the repository:

```bash theme={null}
git clone https://github.com/SoMarkAI/docision.git
cd docision
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.' huggingface_hub
hf download SoMarkAI/Docision-1.0 --local-dir models/Docision-1.0

CUDA_VISIBLE_DEVICES=0 python demo_docision.py \
  --model models/Docision-1.0 \
  --input examples/multiple.json \
  --output outputs/document-decisions.json
```

## Read the results

`examples/multiple.json` asks several questions in Chinese and English about the same table image. One asks for the RR for severely malnourished patients. After running the command, find that question by `id` in `outputs/document-decisions.json`. This excerpt from the project's recorded output shows scores rounded to eight decimal places. [Sample image](https://github.com/SoMarkAI/docision/blob/main/examples/validation-table.jpg) · [Input JSON](https://github.com/SoMarkAI/docision/blob/main/examples/multiple.json) · [Full recorded output](https://github.com/SoMarkAI/docision/blob/main/examples/recorded-output.json)

```json theme={null}
{
  "id": "Docision:c5bc6f4e69f7b8bf_r0q00:en",
  "candidates": [
    { "label": "A", "text": "3.4", "probability": 0.99991417 },
    { "label": "B", "text": "4.8", "probability": 0.00002753 },
    { "label": "C", "text": "2.1", "probability": 0.00005829 }
  ],
  "decision": { "label": "A", "text": "3.4" }
}
```

`decision` shows that the model chose A (3.4). Use `probability` to compare candidate scores for the same question. Review decisions when the scores are close.

## Use your own document image

Save the following JSON to a file and point `--input` to it. Set `image` to a path relative to the input file's directory. In `questions`, list the questions and their candidate answers.

```json theme={null}
{
  "image": "page.png",
  "questions": [
    {
      "id": "category",
      "question": "What type of document is this?",
      "candidates": { "A": "Invoice", "B": "Receipt", "C": "Contract" }
    },
    {
      "id": "stamp",
      "question": "Does this page have a stamp?",
      "candidates": { "A": "Yes", "B": "No" }
    }
  ]
}
```

For several questions about one page, use `stable` inference and prefix caching to reuse the page context. [Package configuration guide](https://github.com/SoMarkAI/docision/blob/main/docs/python-package.md)

## Use cases

| Use case | Example question | Example answers |
| - | - | - |
| Document classification | What type of document is this? | Invoice, receipt, delivery note, other |
| Layout and visual checks | Is there a visible stamp in the signature area? | Visible, not visible, cannot tell |
| Field comparison | Does the order number in the header match the order number in the details? | Match, mismatch, cannot tell |
| Routing under a rule | Records with a signature and a complete date can be archived. How should this page be handled? | Archive, request missing information, send for review |

You can use the same approach to ask questions with defined options about engineering drawings and scientific charts. For example, ask which experimental group each of two curves represents based on the chart legend.

## Ways to use Docision

* **Local Playground**. Upload a document, enter your questions and options, and view the results in the browser.
* **Python or HTTP API**. Add page checks to your application. When you submit a PDF, Docision returns results by page. [Package documentation](https://github.com/SoMarkAI/docision/blob/main/docs/python-package.md)
* **MCP**. Connect to a running Docision service to inspect local documents in Codex or Claude Code and export decisions as JSON or CSV. [MCP setup guide](https://github.com/SoMarkAI/docision/blob/main/docs/python-package.md#mcp)

## Model and public benchmark

Docision-1.0 is based on Qwen3-VL-4B-Instruct. The public `doc-decision-bench` dataset contains 608 document images and 2,617 Chinese–English question pairs, for a total of 5,234 language records. It covers document understanding and decisions as well as classification across industries. [Dataset card](https://huggingface.co/datasets/SoMarkAI/doc-decision-bench)

The project reports **96.18%** accuracy for Docision, **86.78%** for the base Qwen3-VL-4B model, and **95.72%** for JEV-27B-VL on this benchmark. [Official benchmark results](https://github.com/SoMarkAI/docision#benchmark)

The project uses the [Apache License 2.0](https://github.com/SoMarkAI/docision/blob/main/LICENSE).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.