Skills & sessions

Parts

Split a hard question into simple ones. Wity answers each part, then combines the answers by your rule, by weighing them itself, or the way your examples show.

Many decisions are a test with several conditions: a court has jurisdiction only if two things hold; a claim is covered if it happened in the policy period, is not excluded, and was reported in time. Asked in one go, such a question asks Wity to check every condition and combine them at once. Asked as parts, each check is easy, and the combination is yours to define.

Add parts to a skill#

parts maps a name to a yes/no question about the same state: a string, or a full noul question object. A choice part is allowed too, as an object. combine is an optional rule over the part names, with and, or, not and brackets.

curl https://api.wity.alphanimble.com/v1/skills \
-H "Authorization: Bearer $WITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "diversity-jurisdiction",
"question": { "type": "noul", "instructions": "Does the federal court have diversity jurisdiction over this case?" },
"parts": {
"same_state": "Is any defendant from the same state as any plaintiff?",
"amount": "Is the amount in controversy more than $75,000? Add up a plaintiff\u0027s claims against the same defendant; claims against different defendants are not added together."
},
"combine": "not same_state and amount"
}'

Every answer from a skill with parts includes the parts' answers, so you can see why it decided what it did:

"q": {
"type": "noul", "noul": 0.994,
"parts": {
"same_state": { "type": "noul", "noul": 0.01 },
"amount": { "type": "noul", "noul": 1.0 }
},
"skill": { "name": "diversity-jurisdiction", "version": 1, "answered_by": "rule", "active": false }
}

Three ways to combine the parts#

you givethe skill answersanswered_by
parts and a combine ruleby the rule: and takes the least likely part, or the most likely, not flips itrule
parts, no ruleWity reads the state together with its own answers to the parts, then answers the main questionparts
parts and exampleswhichever way was right most often on examples it held back: the question as asked, your rule, Wity weighing the parts, or a combination learned from the examplesexamples

With examples you don't need to write the rule at all: a combination learned from a few dozen labelled cases often finds it, including parts that turn out not to matter. If you do write a rule, it is one of the candidates and is kept only while it does best.

Let Wity write the parts

"parts": "auto" asks Wity to write a few parts from the main question and the skill's first examples. Read what it wrote in the skill object and edit them with PATCH if needed.

When parts help#

  • They help on tests with clear conditions: legal and policy rules, eligibility, compliance checklists. On 120 LegalBench diversity-jurisdiction cases, the two parts above with the rule were right 90% of the time; asked in one go, Wity was right about half the time on the same test.
  • Word each part so it is easy to check. “Is any defendant from the same state as any plaintiff?” is answered far more reliably than “Is every plaintiff from a different state than every defendant?”, though both mean the same: one thing to find beats a condition over every pair. Try wordings on a few cases in the console.
  • They rarely help on judgement calls like tone, intent or sentiment, where the whole is not a rule over the parts. Teach those with examples instead.

Note

Parts are answered together with the main question in the same request, so they add little time. Each part is billed like a question (with the state it reads), and so is the second read when Wity weighs the parts itself. Up to 32 parts per skill.

Previous

← Skills

Next

Sessions →