Repository navigation
Conversation
A join word such as Luganda "mu" ("in") is also an ordinary word. A run of
number words could start with one, so "kasa vo mina epi" had two equally best
readings: "vo" as a word followed by 20,000 XTS, or "vo mina epi" as one
malformed run left unchanged. The runtime picked one silently.
Runs now start with a number word that is not a join. Joins before the first
run with no ordinary word (or the whole input) are words. On 12,121 generated
inputs the output is unchanged; the one difference is that "koin ke mina
otodeka" now has one best reading instead of two (same text). An input that
starts with a join and then an amount now converts: "vo mina epi" ->
"vo 20,000 XTS" (was left unchanged).
Signed-off-by: Lwanga Caleb <[email protected]>
cal3bdev
force-pushed
the
bantu-join-tie
branch
from
November 24, 2026 14:38
016a370 to
f53d51e
Compare
12 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #518. Fixes the one input pattern where the Bantu kernel left two equally best readings for the runtime to choose between.
The problem
Join words such as Luganda mu ("in") or Swahili na ("and") are also ordinary words. A run of number words could start with one, so
kasa vo mina epi(test language) had two readings with exactly the same weight:voas a word, thenmina epias an amount:kasa vo 20,000 XTSvo mina epias one malformed run, left unchangedThis isn't randomness. NeMo always picks the same reading for a given build (today the conversion), but only because of the order the paths happen to be in. A rebuild or Sparrowhawk could pick the other. In Luganda it shows up as
omuwendo guli mu mitwalo ebiri.The change
join_aware_runsinbantu/graph_utils.py: a run now starts with a number word that is not a join. Joins that come before the first run with no ordinary word (or that make up the whole input) are words. Joins between number words still extend the run, and a run can still end on a join at the end of the input, as before.Output
koin ke mina otodekanow has one best reading instead of two.vo mina epi->vo 20,000 XTS(it was left unchanged as a malformed run).Tests
kasa vo mina epi,kasa ke mina otodeka,vo mina epi,vo mina epi vo kasa(money) andvo ke(word). Each also checks for exactly one best reading.pytest tests/nemo_text_processing/bantu tests/nemo_text_processing/toy --cpu: 160 passed, 100% line coverage ofbantu/andtoy/.No other files changed. The import cycle and header fix are left for the refactor, as agreed.