Logo Lanfrica

Nama-ResearchLab/Sema

Domain:

natural language processing

Record type:

software
Creator:
Nam
Host:
Offline Swahili semantic anchoring for LLM apps — distilled Wiktionary lexicon (19.7k lemmas) + morphology-aware word resolver. No cloud, no model required. From the Eden (EDENN) project.  # Sema **"say" in Swahili** *Offline semantic anchoring for low-resource languages.* --- Your model barely speaks Swahili. Your users only speak Swahili. Small LLMs are overwhelmingly English-trained. Fine-tuning is expensive. Translation APIs need the cloud. **Sema** takes the boring, deterministic route that actually works on a phone with no signal: ``` anchor your model render Swahili input ----------> English ----------> structured -------> Swahili (Sema) skeleton reasons here templates output (never back-translate prose) ``` Sema provides step 1: it resolves surface words to lemmas, parts of speech, English glosses, and derivational roots -- fully offline, in microseconds, from a 1.8 MB data file. ## What's in the box | | | |---|---| | **19,717 lemmas** | nouns / verbs / adjectives / more -- distilled from Wiktionary | | **Morphology-aware** | `umefikia` -> `fikia` (*arrive at*, root `-fika`) via language affix rules | | **Zero dependencies at runtime** | no network, no API keys, no models | | **1.8 MB** | ships inside any app; regenerable from raw dumps | ## Quickstart ```bash git clone github.com cd Sema cargo run --release --example acceptance ``` Real output: ``` SW: umefikia wapi? -> umefikia[fikia:verb 'Applicative form of -fika: to lodge at, ... arrive at' root=-fika] -> wapi[wapi:adv 'where'] -> ?[?? unresolved] ``` Use it as a library: ```rust let lex = sema::Lexicon::load("data/swahili.distilled.jsonl")?; // exact hit lex.skeleton_for("habari"); // habari[noun] 'news' // affix-resolved verb form lex.skeleton_for("unasema"); // unasema -> sema[verb] 'to say, speak' ``` ## The double-pass pattern Sema is deliberately **not** a translator. It is the anchor layer of an architecture for serving low-resource-language users with strong-in-English models: 1. **Anchor** -- Sema turns Swahili text into an English semantic skeleton 2. **Reason** -- your LL …