Brainstorming With Gemini
The Birth of Mjengulizo -- The Deconstructor -- and his Amazing Superpower
“Hi Gemini, I want to brainstorm a Ruby program with you…”
With that innocuous start yesterday, Gemini And I (AI?!) began a four-hour fun-filled session considering the possibility of a software utility to input lines of Swahili text and extract out non-trivial words (including verbs).
I came up with an idea of how to automate the extraction of major swahili vocabulary from a text document.
Gemini rightfully tussled with me regarding the definition of “non-trivial”, how it could be determined, and most importantly, the difficulty in discerning verbs and resolving them to their canonical ‘dictionary’ form.
Like an eager race horse ready to leap and prance around the pasture, at every turn Gemini, was trying to spit out algorithms and design code … prematurely to my liking.
I like maximum benefit from extremely minimal effort.
I had to rein Gemini in, focus his awesome knowledge on the basics, and steadily move him towards an evaluation of the possibilities and scope of such a project. I like maximum benefit from extremely minimal effort. I think this could be one of those utility routines.
We had to first determine a strategy for tackling the problem and most importantly what the core programming design challenge would be. (See pseudo-algorithm at end of this article.)
It soon became clear that a verbal deconstructor would be the biggest issue. The key is how to deconstruct verbs (which in Swahili1 are agglutinated with multiple prefixes and suffixes) into their root cores.
But how to do that? Gemini was wringing its little AI hands over the difficulty of that, the special cases, etc etc. But my mind began swirling with the excitement of an innovation ... using a virtual machine2 which is fed all the lexical rules for constructing swahili verbs.
I estimated I could do it in 20-50 lexical rules.
Gemini pish-posh-ed me, saying “30-70 at best, puny human.” And on top of that, Gemini added with a sniff of disdain, that even if I did it in less than 70 rules I would not be able to handle a truly comprehensive range of verbs, the likes of which only a sophisticated LLM (such as Gemini??) would be able to generate. Rather passively aggressively it added, “But human, you are the user after all …(long pause), so if you really want to try that, go ahead, knock yourself out.”
I said: "ok Mr Gemini, challenge accepted! I will bet you that i can reach a comprehensive, virtual-machine processable set of Lexical Rules that will encompass 98% of modern kiswahili verb usage."
It then tried to say "well, whatevers, who really knows what you really mean by "virtual-machine processable (sniff).”
(Really, I distinctly heard Gemini sniff with disdain.)
Me: “It means that I can create a general purpose virtual machine, which itself will be without a specific knowledge of Swahili verbs, but designed to accept tables of lexical-rules (which might be recursive or sub-ruled and referenceable from other rules), and accepting a valid Swahili actual usage verb combination, be able to deconstruct it and yield the completed verb root, both the canonical (ie dictionary form) as well as the canonical usage form.” (these forms can sometimes also be in the dictionary because they have a distinct meaning for that usage.)
“Further, I'm estimating that the number of rules (included sub-rules referenceable by larger rules) will be about 20 - 50.”
“Is this now clear to you?” (I was a bit bothered by its Valley Girl ‘whatever do you mean’ resistance.)
Gemini: “Understood.”
Me: “Exactly ... and at this moment of LLM coding ability, I will also show how a human-based intuitive and elegant breakdown of problems by discerning complex patterns can be superior to brute-force LLM-generated approaches.
“You had two predictions:
“1. ‘number of lexical rules needed to describe Kiswahili verb construction typically falls within the range of 30 to 70 rules.’
“2. ‘While 20-50 rules, as you mentioned, could cover the most common and fundamental constructions, reaching a comprehensive description that accounts for less frequent but valid forms, as well as the nuances of phonological assimilation, would likely push the number towards the higher end of my estimate.’
“I hope to prove BOTH predictions wrong!”
Later on, after I let him cool down, we had fun coming up with a name and an image for the deconstructor.
I like having project or module names which are from Swahili. I generated one word; Gemini graciously accepted that it was a rather unique construction which might be understandable to a native speaker, and then proferred two other names. So we had a total of three names to consider.
Mjengulizo -- The Deconstructor
Mchambuzi -- The Decomposer
Mjunvuzi -- The Demolisher
I rather liked both the personification, vibe, and moniker for each, so I asked Gemini to draw some superhero/monster images for them. I chose the image for Mjengulizo, shown at the start of the article.
The End
Appendix: The overall processing plan
(shown below in my pseudo-code algorithmic style):
until (EOF) {
INPUTTER: Read a LINE
TOKENIZER: {
Split the line into individual WORDs
(easy: break on whitespace/punctuation)
Discard punctuation
Discard extremely trivial words
(ex: conjunctions, pronouns, numbers, etc)
replace each word with CANONICAL-TRANSFORM(WORD)
}
For each WORD in the tokenized line: {
if( Non_trivial_match?( WORD ) ) {
OUTPUTTER( WORD, Snippet( WORD, LINE ) )
} // if match
} // for each WORD
} // unless
OUTPUTTER( word, line) {
put( word )
if option_snippet put( snippet( word, line )
put( eol )
}
Footnotes:
Swahili verbs are the freight train of any sentence, and are assembled with multiple prefixes and suffixes to denote person, tense, direct object, relative marker, and various moods (passive, causative, reciprocal, etc), with the verb stem sitting in the middle, carrying the load. In Swahili grammar, these serve to carry multiple lines of complex and layered pronominal interconnections between multiple nouns and lines of action, unlike English which at best might have two pronouns in a sentence.
But this morphology would be challenging to detect. I had some ideas on how to do this, similar to the assembler/disassembler I wrote (years ago, I know) for the 68000 CPU. But the principal would be the same: a virtual machine, controlled by a “database” of lexical rules which could automatically process a stream of text and deconstruct an element into its primary machine-code operand.