Skip to content

Scoring

Verified against source (17)

  • score/Score.cs
  • score/ScoreTemplate.Fields.cs
  • score/ScoreItemTemplate.Fields.cs
  • score/Enumerations.cs
  • Config/ScoreEngine.config
  • Config/ScoreTemplate.config
  • score/Engines
  • score/readme.md
  • Config/SmartWorklist.config
  • qbo4.Document.Aspose.Bridge/CellsEngine.cs
  • Extensions/WorkbookExtensions.cs
  • qbo4.Document.Bridge/TextractScoreEngine.cs
  • qbo4.AI.Bridge/AIScoreEngine.cs
  • qbo4.AI.Bridge/AiModalEngine.cs
  • Extensions/ScoreExtensions.cs
  • qbo4.Scoring.Bridge/CompositeEngine.cs
  • qbo4.Scoring.Bridge/CompositeEngineOptions.cs

A score template defines what to calculate; its engine decides how. Pick the engine that matches where your logic already lives: a rules matrix, an Excel model, a SQL query, or a document to read.

Setting Property Purpose
Engine ScoreEngine The plugin that calculates the score. See Scoring engines.
Applies to Object The kind of record scored (for example Contact, Document, or Message).
Method Method Where the engine’s input comes from. See Data sources.
Value type ValueType Type of the overall score value.
Engine parameters EngineParameters Engine-specific options, in query-string form.
Render RenderID A file the engine uses: the Excel model or the XSLT transform.
Repeatable Repeatable One score per record, one active, or many. See Templates.

Each item is one data point:

Setting Purpose
Name The item’s name. Engines match it by its safe name (spaces and special characters removed: Due Date becomes DueDate).
Value type Money, Int, Float, Boolean, String, Date, or Enumerated. The value is stored in a typed column.
Prompt For text parsing, the pattern to find; for AI, the instruction describing the value.
Enumeration Allowed values for an Enumerated item.
Weight How much the item counts toward the score’s overall confidence (default 1; 0 excludes it).
Label, Sequence How the item is labeled and ordered on screen and in audits.
Mask, Unmask permission Mask a sensitive value, and the permission needed to see it unmasked.

The template’s Method decides what the engine receives:

  • A method signature, such as Contact/Summary?ID={ObjectID} or a custom statement. Its results (rows or XML) are passed to the engine.
  • Parameters: the values passed on the calculate call are used directly. This turns a score into a calculation service.
  • Empty: the engine works from the scored record itself (for example, the document being read).
Engine Name Input How it scores
Matrix Matrix Parameters, query row, or record Looks up the rules matrix with the same name as the template, and saves each matrix output to the matching item.
Excel Aspose Cells integration Record summary, query results, or parameters Merges data into the template’s Excel model, recalculates it, reads results from named cells, and saves the completed workbook with the score.
API ApiEngine Method results Saves any returned column whose name matches the score or an item. Ideal for caching expensive statistics.
XSLT Xslt Method returning XML Transforms the XML with the template’s XSLT into elements named after items.
Text parsing TextParsing A document or message Finds each item’s prompt pattern in the text, running OCR on documents first if needed.
AI (text) AiScoreEngine A document or message Converts the document to text and asks an AI model to extract every item, with confidence.
AI (multimodal) AI integration A document Sends the original file (PDF, image, audio) to the model, with no text conversion.
Amazon Textract TextractEngine A document Extracts each item by name with Amazon Textract and saves its confidence.
Composite Scoring integration Any Runs several engines or templates and keeps the most confident value for each item.

In the workbook, give a cell a name and add a comment starting with ?= to inject data:

  • ?=FieldName places a single value.
  • ?= followed by a method signature places a table of results.
  • ?=Matrix:{Matrix}:{Output} places the best-matching rule output.

To extract results, name cells ScoreValue (the overall value) and after each item’s safe name. A cell named {Item}Confidence sets that item’s confidence.

Prompt Finds
Invoice Total: {Value} The value after Invoice Total:, parsed as the item’s type.
Due{Value}{Newline} The value between Due and the end of the line.
Signature on file (Boolean item) Yes if the text appears, No if not.

One match gives confidence 100. No match gives 0. Several matches lower confidence by 25 per match.

Set AgentName in Engine parameters to choose the configured AI agent (it defaults to the engine’s name without Engine). UseConfidence=false skips per-item confidence. The multimodal engine also accepts FileExpirationMinutes, to reuse an uploaded file when the same document is scored repeatedly.

Set Engine parameters to choose what to combine:

Parameter Default Effect
Engines AiScoreEngine,TextractEngine Engines to run, in order, against this template.
Templates Other score templates to run instead (their item names must match).
Label {Score} - {Name} Name of each child score.
Confidence 0.8 Stop once a child score’s confidence exceeds this. Set 0 to always run everything.

Each child is saved as its own score and linked to the composite, so you can compare models side by side.

To audit completed work:

  1. On the worklist template being audited, create an audit matrix. Its outputs choose which completed items to sample: Template (the audit worklist and score template name), Percent, Minimum, and Maximum.
  2. Create a score template with the same name as the matrix’s Template output. Each item becomes an audit question.
  3. Run Audit on the worklist. QBO samples eligible items into the audit worklist; auditors answer the questions on the original page.

If your logic is already a rules matrix, the CreateFromMatrix statement builds the score template for you: one template per selected matrix (named after it, using the Matrix engine), with an item for each matrix output and a matching value type. Matrices that already have a score template are skipped.