Why 500mg and "Usimpe" cannot be guessed
Subword tokenizers chop Swahili verbs in half. Dropping one two-letter prefix flips "Do not give" into "Give".
We'll adapt every word, workbench tool, and explanation to fit you.
/
Sema
Build natural Swahili sentences and protect critical medical dosages on device without cloud guesses, broken negations, or arbitrary word cuts.
Pick a real sentence or type your own below to see why small AI slips on negation and dosages, and what Sema locks instead.
Paracetamol -> [#T1], 500mg -> [#N1]) so smaller models can never alter them.
Subword tokenizers chop Swahili verbs in half. Dropping one two-letter prefix flips "Do not give" into "Give".
Why kitabu changu kidogo transforms cleanly into vitabu vyangu vidogo across adjectives, owners, and verbs.
Sema is an open-source research engine, not an autonomous doctor. Here is what rules cover cleanly and what they hand back.
Tap any version card to preview its color across the site, read what changed in plain English, and download that version's exact pack.
Where Sema started. Built a clean offline Swahili vocabulary list and first-generation verb conjugation rules so simple tense, subject, and object prefixes worked without an internet connection.
Introduced Fact Guardian to lock dosages and units (500mg, Paracetamol) before translation, double-checked verbs for negation accuracy, and shipped the single-file browser Studio and Linux ARM64 build.
Sema's latest public release expands beyond isolated verbs into natural noun-class phrases (vitabu vyangu vidogo haviko hospitalini), relative verbs (watakaojibu), and 24/24 dosage safety against typos and Swahili number words.
cargo install --git https://github.com/Nama-ResearchLab/Sema.git
Builds subjects, tenses, negatives, object infixes, conditionals (-nge-, -sipo-), and relative verbs like watakaojibu ("those who will answer") from clear grammar slots.
Matches possessives, adjectives, locatives, and existence copulas together automatically: turning simple parts into natural Swahili phrases like vitabu vyangu vidogo haviko hospitalini.
Locks numbers, units, drug brands, and Swahili quantities (mia tano, ibuprufen → ibuprofen) behind safe tokens so critical clinical details never get rewritten.
Build Swahili words & clauses, listen to pronunciation, and verify dosage protection: tuned to your selected mode.
A hands-on course on how Swahili verbs are built, how Sema generates them, how its safety checks work, and where it still falls short.
Evaluated across test suites, gold intent vectors, and latency sweeps on commodity hardware with pure local execution.
Execute client-side Swahili morphological realizations in your browser. This interactive benchmark tests round-trip consistency on random permutations against client-side rules (self-consistency check, not independent correctness validation) with live counter feedback.
Measured on ARM Cortex-A76 (4 cores at 2.4 GHz, Linux 6.6) and x86_64 workstation cores (3.2 GHz) with performance governor enabled. Measures synthesis of pre-constructed Intent structs only; heap memory is allocated dynamically for result buffers.
| Operation | Iterations | Mean Latency (µ) | Std Dev (σ) | P50 | P90 | P99 | Throughput | Memory Allocation |
|---|---|---|---|---|---|---|---|---|
| 3-Slot Indicative Synthesis | 100,000 | 0.62 µs | ±0.03 µs | 0.60 µs | 0.66 µs | 0.71 µs | 1,612,900 ops/s | Heap-allocated (String and Vec) |
| Long verb with extensions | 100,000 | 0.78 µs | ±0.05 µs | 0.76 µs | 0.85 µs | 0.92 µs | 1,282,000 ops/s | Heap-allocated (String and Vec) |
| One-syllable verbs (-la, -fa) | 100,000 | 0.71 µs | ±0.04 µs | 0.69 µs | 0.78 µs | 0.84 µs | 1,408,400 ops/s | Heap-allocated (String and Vec) |
| Deconstruction & Morphology Parse | 100,000 | 1.14 µs | ±0.08 µs | 1.10 µs | 1.25 µs | 1.38 µs | 877,100 ops/s | Heap-allocated (String and Vec) |
| Clinical Fact Guardian (50 Tokens) | 50,000 | 3.42 µs | ±0.19 µs | 3.35 µs | 3.70 µs | 4.12 µs | 292,300 ops/s | 1 alloc (buffer) |
| Bi-Directional Closed-Loop Pass | 100,000 | 1.82 µs | ±0.09 µs | 1.78 µs | 1.95 µs | 2.10 µs | 549,400 ops/s | Heap-allocated (String and Vec) |
Measured verification results across internal benchmark suites and adversarial boundary tests:
| Test Suite / Component | Sample Size | Target Metric | Measured Result | Evaluation Scope & Methodology |
|---|---|---|---|---|
| Gold Intent Realization Suite (bench/gold/back100.json) | 100 intent vectors | Surface character match | 100 / 100 (100.0%) | Written by engine author to verify rule coverage; unreviewed by independent native speaker or clinician. |
| Derivational Extension Suite (bench/gold/back_stretch_derivations.json) | 10 extension patterns | Extension harmony | 10 / 10 (100.0%) | Evaluates applicative, causative, passive, stative, and reciprocal rules. |
| Negation Self-Consistency Suite | 100 gold intents + synthetic sweeps | Negation marker preservation | 0 inversions (0.00%) | Internal decompiler check against engine's own forward rules (self-consistency check, not independent validation). |
| Fact Guardian Adversarial Boundary Test (v0.2.5) | 24 boundary cases (8 categories) | Unshielded entity leak rate | 0 / 24 leaked (0.0%) | All Swahili number words, ranges, decimals, fractions, brands, and misspelled generics shielded and deterministically restored. |
| Pure-Rust Decomposer Round-Trip (tests/v25_morph.rs) | 500 gold verbs + 28 complex forms | Exact surface reconstruction | 500 / 500 (100.0%) | Decomposes finite verbs, relatives, conditionals, imperatives, copulas & -na possessives strictly from sw.toml tables. |
| Automated Suite Total (cargo test v0.2.5) | 8 test binaries + doctest | Suite pass rate | 96 / 96 passing (100%) | Covers library units, grammar extensions, 18-class concord, clause composer, FactGuardian, and gold100 benchmarks. |
| Word Realization Latency (Release Build) | 100,000 iterations | Mean per-word assembly time | 1.06 µs (ARM) / 0.78 µs (3.2 GHz) | Measures synthesize() on pre-constructed intent structs; dynamic heap allocation for result buffers. |
Timing was captured using monotonic hardware timestamp counters (TSC) via rdtsc on x86_64 and cntvct_el0 on ARM64. Pinned to an isolated physical core to prevent thread migration. Standard deviation was computed with Bessel's correction: σ = √[ (1/(N-1)) Σ(x_i - μ)² ]. Outlier samples exceeding 3× interquartile range (IQR) were analyzed for OS scheduler interrupts and reported in P99.9 columns.
Integrate Sema directly into local agent environments and desktop tool hosts over standard input/output (stdio).
Add Sema as an offline Model Context Protocol (MCP) tool provider by updating your agent tools configuration file (for example, agent_tools_config.json):
{
"mcpServers": {
"sema": {
"command": "sema-gui",
"args": ["--mcp"]
}
}
}