Skip to main content
A Choice question always picks an option, even when none of them applies. Ask which of three things an input is about, and an input about none of them still gets an answer, possibly with a high probability. The model is answering the question it was asked, so it picks whichever of the three options is closest. To fix this, add a second question to the same request: a Noul question that asks whether any of the options fits at all. Your code uses the answer to the Choice only when the Noul is a clear yes.

Example: routing messages to product teams

Say you sell three products, and you send each support message to the relevant product team. Messages about anything else, such as a lamp from another shop or a note from a recruiter, go to a general inbox instead.

Ask which product, and whether any fits

Both questions refer to the product list by its key in the state, products. Jev sees the Choice question’s option names, so names such as desk_pro say what each product is. The false criterion on the Noul question lists what counts as a no: another product, a service, or something you don’t sell. Jev’s response:
The Choice picks desk_pro at 0.96, with a confidence of 0.94. Nothing in that answer tells you the message isn’t about your desk. Of the three options, a desk lamp is closest to a desk. The companion Noul reads 0.02, which says the message isn’t about any of your products. Here are Jev’s answers for four different messages:

Trust the Choice only when a product fits

Read the Noul first. On a clear no, ignore the Choice and send the message to the general inbox. A clear yes says the message is about one of your products, but not which one, so also check the probability of the product the Choice picked. If both are high, send the message straight to that product team. Otherwise, a general support agent decides, with the Choice’s pick passed along as a suggestion.
route.py

Why an other option falls short

Adding other: 'Something else' to the Choice question looks like less work, and it used to be the usual advice. But other competes with the product options for probability. A message that is partly about a product and partly about something else splits its probability between other and that product, and neither number tells your code what to do. With a companion Noul, the Choice question only picks among the products, and a separate question with concrete true and false criteria decides whether any product fits. In our tests, that usually works better.
Box, which is a question type for finding where something is in an image, has the same problem: it always returns a location in an image. Pair it with a Noul question such as “Is there a coffee mug in photo?” so your code knows whether the box marks a mug at all.

Other ways to use a companion Noul

  • One Noul question per option. When a message can be about more than one product, a Choice has to split its probability between them. Ask one Noul question per product instead, and read each one on its own. Then the case where nothing fits needs no extra question, because every Noul comes back low.
  • As a screen. Ask a Noul question first, and run the expensive step, which may require a Choice or Score, only when the answer is a clear yes. See screen with a Noul first.
  • Candidates from code. The options don’t have to be a fixed list. Your code can pull possible values out of the text and use them as the options in the Choice question, and the companion Noul question asks whether the right value is among them. The value extraction cookbook builds candidates in code this way, but it uses a none option instead of a companion Noul.