Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(readme): routing metadata is five keys, not the three the page showed

Adeshina Lasisi0d2113aa9070
diff --git a/README.md b/README.md
index 0b157ce9..68c1a698 100644
--- a/README.md
+++ b/README.md
@@ -659,10 +659,21 @@ res_hi["routing"]
# {
# 'model': 'multilingual',
# 'repo': 'convaiinnovations/laya/multilingual',
-# 'reason': 'non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it'
+# 'reason': 'non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it',
+# 'detection': {'script': 'devanagari', 'script_profile': {'devanagari': 1.0},
+# 'language': None, 'is_english': False, 'language_undecided': True,
+# 'diacritic_rate': 0.0, 'non_latin_fraction': 1.0, 'mixed_segment': None},
+# 'workflow': None
# }
```
+All five keys are always present. `detection` is the
+[`laya.lang.analyse`](#supplying-your-own-language-detection) result the decision was made from,
+and is `None` whenever routing decided before detection ran: `model=`, `task=`, a detected
+workflow, a decisive `lang=` and a resolving `lang_guess` all take precedence over it and
+short-circuit it. `workflow` names the typed-decisions workflow whose question ids matched, and is
+`None` when none did.
+
Inspect a routing decision without running any forward pass:
```python