mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* android typing: a reproducible Brazilian Portuguese model (pt.hextm, pt.valid, pt.capitals), not wired up yet
Google Books has no Portuguese, so the model is counted from sources licensed for commercial use
with attribution only (CC BY 4.0), each file pinned in benchmark/typing/pt-inputs.tsv by URL, fetch
date, size and SHA-256:
- 14 Leipzig Corpora Collection news downloads (only the downloads; the site and API are CC BY-NC),
each sentence given to Brazil or Portugal by its site (.br, .pt, else spelling markers).
- ParlaIbero-BR and -PT v2 (Câmara dos Deputados 2009-2025, Assembleia da República 1995-2025).
build-layout-model.py pt: Brazil's counts (181.5M news words, 138.1M words of speech), news counted
ten times a speech for words and alone for word pairs (with speech pairs in, "obrigado" was followed
by "sr" and "deputado"), less spellings retired in 1990 ("idéia", "vôo") and plain twins 20 times
rarer than an accented one ("nao", "voce", Polish's rule), plus Hex's own chat words
(pt-extra-words.tsv, a draft for a Brazilian speaker to read). 100,029 words, 380,416 pairs, 3.60 MB.
build-valid-words.py pt: Brazil's other lowercase spellings, then Portugal's own spellings from
Portugal's counts ("telemóvel", "receção"), so a Portuguese typist's correct word stays as typed.
build-capitals.py pt: case shares from the same Brazilian counts, held as French's are.
Held-out set: portuguese_set.py makes held-out/pt.tsv.gz exactly as polish_set.py makes Polish's,
from Brazilian contributors' Tatoeba sentences; accent keys and seven critical cases added.
quality-gate.py now takes more than two critical cases (Polish already had five).
The APK pins the three new files (SHA256SUMS, verifyTypingModels); no layout or keyboard code
reads them yet, so nothing a person sees changes.
Verified: a from-scratch rebuild on the Studio in a separate folder gave byte-identical files
(pt.hextm 387bf9b6..., pt.valid b92acc12..., pt.capitals 0210f5bd...); 12,800 of the 12,873
held-out reference words are model or list words; on 5,000 other Brazilian Tatoeba sentences the
model reads 6.54 nats per known word (news only 6.55, speech only 6.90, both alike 6.59).
Not yet run: quality-gate.py pt (it compiles the app with Gradle, which waits for the coordinator).
* android typing: Portuguese words the context decides (é or e, está or esta), and a held accent stays
Step 4 of Portuguese typing. ContextWords gets Portuguese groups: the same letters with and without
an accent ("e"/"é", "esta"/"está", "nos"/"nós", "a"/"à", ...) and a verb beside the noun its accent
makes ("duvida"/"dúvida", "pratica"/"prática", "magoa"/"mágoa"). build-layout-model.py keeps those
verbs in the model (PT_CONTEXT_WORDS, the same words) although the plain-twin rule would leave them
out, so the words around can pick them; the rebuilt pt.hextm, pt.valid and pt.capitals differ only by
those 20 words and the pairs and costs that follow.
A Portuguese word typed with an accent held for it is no longer revised by the next word
(ContextWords.keepsTypedAccent): with the groups alone, the next word turned 26 held "é" into "e"
and 14 "à" into "a" in the clean replay, and correct words changed rose to 0.58%. French and
Italian keep revising a held accent, as before.
Verified with quality-gate.py all on the Studio (host JVM, Gradle --no-daemon, no emulator):
pt 83.75% fewer errors than raw taps (81.23% before), 0.16% of correct words changed (0.09%),
98.30% of unambiguous accents restored (98.31%), 51.98% of ambiguous ones (21.61%), ambiguous harm
0.29% (0.03%), critical cases 7/7 (6/7: "ele e muito bom" -> "ele é muito bom" now passes); PASS.
en, es, de, nb, fr and it: the gate's output identical field for field to origin/dev's.
Known limit, measured on Tatoeba sentences outside the held-out set: of 152 uses of those verbs
typed as written, 38 stay (13 before); 114 still become the noun. Simple pluperfects ("acontecera")
become the future. The held-out set has one such word ("recebera") and none of the verbs.
* android keyboard: Português gets its own layout and typing model, accent holds, swipe and filter
Step 5 of Portuguese typing. Português, dictated or pinned in Keyboard › Keyboard layout, now types
with its own model instead of English's word list standing in (Spoken.Portuguese, "pt"):
- Keys: QWERTY, as English's (KeyboardLetters "pt").
- Holds: iPhone Hex's Portuguese long presses (KeyboardLanguage.swift) on a, e, i, o, u, c and n;
other letters hold nothing, as on iPhone.
- The strip's words between words: "eu", "o", "a" at a sentence's start, "e", "mas", "que" after a
comma, and the commonest words where the pairs know none.
- never-suggest.tsv: Portuguese rows curated from LDNOOBW's pt list (CC BY 4.0, credit extended):
11 slurs (viado, bicha, paneleiro, sapatão...) and 43 swear words with common inflections;
ordinary words on that list (comer, cerveja, burro, saco, transar) and veado (deer) stay.
- Swipe: swipe_paths.py and swipe-bench.py know "pt".
Nederlands, Polski and Русский keep English's word list as a stand-in, as before.
Tests (existing files): InsertionTest now expects Português's layout and typing model;
NeverSuggestTest runs its filter, between-words and swipe checks for pt as for the other six.
Verified on the Studio (host JVM, Gradle --no-daemon, no emulator): testDebugUnitTest passes;
quality-gate.py all: pt PASS (83.75% fewer errors, 0.16% correct words changed, 98.30% accents,
7/7), the other six identical field for field to origin/dev's; swipe-bench.py, typical fingers:
pt 96.3% first word right, 99.5% typed or in the strip over 11,580 swipes, the other six as in the
README table. Not yet checked on an emulator.
* android typing: an infinitive before "-lo" or "-la" is no Portuguese word of its own
Found on the emulator: typing "obrig" offered "obrigá" in the strip. The counter split "obrigá-lo" at
its hyphen, so 569 infinitives written for an enclitic pronoun ("fazê", "ajudá", "tê") were model
words, offered as readings and completions and once read for "te" ("deverias te esquecer" ->
"tê"). build-layout-model.py now skips a word ending in á é ê í ô that "-lo", "-la", "-los" or
"-las" follows; the rebuilt pt.hextm, pt.valid and pt.capitals take other words in their place.
Verified on the Studio (host JVM, Gradle --no-daemon): quality-gate.py all, pt PASS: 83.81% fewer
errors than raw taps (83.75%), 0.16% correct words changed, 98.30% unambiguous accents, 51.98%
ambiguous, harm 0.27% (0.29%), 7/7, and "te" is no longer changed in the clean replay; the other
six identical field for field to origin/dev's. testDebugUnitTest passes. swipe-bench.py: pt 96.3%
first word right, 99.5% typed or in the strip over 11,581 swipes; the other six unchanged.
* android typing: no Portuguese word writes ç before e or i
Found on the emulator: a swiped "voce" offered "voçê" in the strip. Portuguese never writes ç
before e or i, so build-layout-model.py drops such spellings (5 model words: voçê, voçe, conheçe,
tropeçe and a Turkish club's name); the rebuilt pt.hextm, pt.valid and pt.capitals take other words
in their place. The benchmark README also records the emulator check in an outside app.
Verified with quality-gate.py, testDebugUnitTest and swipe-bench.py on the Studio after the merge of
dev that follows (numbers in that merge's pull request update).
76 lines
6.3 KiB
Text
76 lines
6.3 KiB
Text
Whisper model weights by OpenAI; Q5_1 conversion distributed by Georgi Gerganov. MIT.
|
||
whisper.cpp and ggml by Georgi Gerganov and contributors. MIT.
|
||
Faster English dictation (Labs): Parakeet TDT-CTC 110M model weights by NVIDIA, CC BY 4.0, converted to GGUF and
|
||
quantized to 8 bits by the transcribe.cpp authors; downloaded only when you ask. See parakeet-model.txt.
|
||
transcribe.cpp by the transcribe.cpp authors, with ggml, miniz and Silero VAD code. MIT. See transcribe.cpp.txt.
|
||
Kotlin and AndroidX: Apache License 2.0. LLVM libc++: Apache 2.0 with LLVM exceptions.
|
||
The keyboard's emoji panel: the AndroidX emoji picker and Guava, by Google. Apache License 2.0.
|
||
The keyboard's emoji suggestions: Unicode emoji-test.txt 18.0 and CLDR 49 names and
|
||
keywords, Unicode License v3. Full licence: unicode.txt.
|
||
Inter by Rasmus Andersson and the Inter Project Authors. SIL Open Font License 1.1.
|
||
Unmodified InterVariable.ttf from https://github.com/rsms/inter/releases/tag/v4.1
|
||
|
||
Keyboard suggestion filter: List of Dirty, Naughty, Obscene, and Otherwise Bad Words
|
||
(LDNOOBW), © 2012–2020 Shutterstock, Inc., and contributors. English, Spanish, German,
|
||
Norwegian, French, Italian and Portuguese lists. Source: https://github.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/tree/5faf2ba42d7b1c0977169ec3611df25a3c08eb13
|
||
Creative Commons Attribution 4.0 International: https://creativecommons.org/licenses/by/4.0/
|
||
Full licence: cc-by-4.0.txt. Hex lowercased and classified the entries, omitted ordinary,
|
||
medical and search-only terms, and added common slurs, inflections and spelling variants.
|
||
|
||
English, Spanish, German, French and Italian keyboard language models (.hextm): derived from Google Books Ngram
|
||
Viewer, version 3 (2020-02-17), by Google and the Google Books Ngram contributors.
|
||
https://storage.googleapis.com/books/ngrams/books/datasetsv3.html
|
||
Creative Commons Attribution 3.0 Unported: https://creativecommons.org/licenses/by/3.0/
|
||
Changes: lowercased and summed word and word-pair counts for 1980–2019, filtered
|
||
spellings, selected informative pairs, and quantized probabilities into HXTM v3.
|
||
The English, Spanish, German, French and Italian capitalization lists (.capitals) come from the same corpus's
|
||
word counts for 1980–2019: the share of each word written with a capital first letter.
|
||
The Spanish, German, French and Italian validity lists (.valid) come from the same word counts:
|
||
spellings outside each model used at least 3,000 times (German: 10,000), with each word's count
|
||
quantized to a cost.
|
||
|
||
German, French and Italian use their corpus's alphabetic spellings; no external dictionary. French and
|
||
Italian keep the books' elided forms ("c'est", "dell'anno") and leave out the same letters run together.
|
||
English literal validity also uses SCOWL words, proper names, uppercase forms and abbreviations
|
||
outside the frequency model, lowercased and sorted; these spellings carry no word probabilities.
|
||
English spellings: SCOWL 2020.12.07, sizes through 70; Kevin Atkinson and contributors.
|
||
Permission and individual source notices: scowl.txt. https://wordlist.aspell.net/
|
||
Spanish spellings: RLA-ES Hunspell dictionaries (es_ES and es_MX), coordinated by Santiago Bosio,
|
||
used under Mozilla Public License 1.1. The frequency model filters by these spellings;
|
||
the original dictionaries are unmodified. See mpl-1.1.txt, rla-LICENSE.md and rla-README_hunspell_es.txt.
|
||
Source files: https://github.com/LibreOffice/dictionaries/tree/762abe74008b94b2ff06db6f4024b59a8254c467/es
|
||
|
||
Norwegian Bokmål keyboard language model: N-grammer fra Nasjonalbiblioteket 2026,
|
||
National Library of Norway (Nasjonalbiblioteket). Book unigrams and bigrams ("digibok"),
|
||
language nob, 1980–2019. CC0 1.0 Universal: https://creativecommons.org/publicdomain/zero/1.0/
|
||
https://data.norge.no/nb/datasets/f2eebe8b-bd83-34e4-bcf3-c0c5e37a77f8/n-grammer-fra-nasjonalbiblioteket-2026
|
||
Spelling filter: Norsk ordbank – bokmål 2005, 1 February 2022, University of Bergen
|
||
(Universitetet i Bergen) and the Language Council of Norway (Språkrådet), distributed by
|
||
Nasjonalbiblioteket. CC BY 4.0: https://creativecommons.org/licenses/by/4.0/
|
||
https://data.norge.no/en/datasets/f0db926d-a154-3a12-82b8-6573b57f6dbb/norsk-ordbank-norwegian-bokmal-2005
|
||
Changes: normalized and lowercased word forms, filtered the book counts to attested
|
||
Bokmål spellings, selected informative pairs and quantized probabilities into HXTM v3.
|
||
The Bokmål validity list (nb.valid) is the Norsk ordbank standard full forms outside the model
|
||
that the same book counts use at least 1,000 times, with each word's count quantized to a cost.
|
||
|
||
Portuguese (Brazil) keyboard language model (pt.hextm), capitalization list (pt.capitals) and
|
||
validity list (pt.valid): word and word-pair counts from the Leipzig Corpora Collection's
|
||
downloadable Portuguese corpora (por-br_newscrawl_2011, por_news_2019 to 2024, por_newscrawl_2011
|
||
to 2020, por-pt_newscrawl_2011 and por-pt_web_2014 and 2015, 1M sentences each), Leipzig University
|
||
and the Saxon Academy of Sciences and Humanities in Leipzig: D. Goldhahn, T. Eckart and
|
||
U. Quasthoff, Building Large Monolingual Dictionaries at the Leipzig Corpora Collection: From 100
|
||
to 200 Languages, LREC 2012. https://wortschatz-leipzig.de/en/download
|
||
And from ParlaIbero-BR: Parliamentary Speeches from Brazil (2003-2025) and ParlaIbero-PT:
|
||
Parliamentary Speeches from Portugal (1976-2025), version 2, by Rodrigo Rodrigues-Silveira,
|
||
University of Salamanca, Harvard Dataverse. https://doi.org/10.7910/DVN/VTXNW3 and
|
||
https://doi.org/10.7910/DVN/VRPUFU
|
||
Both under Creative Commons Attribution 4.0 International: https://creativecommons.org/licenses/by/4.0/
|
||
Full licence: cc-by-4.0.txt.
|
||
Changes: gave each news sentence to Brazil or Portugal by the site it came from, lowercased and
|
||
counted words (Brazil's speeches from 2009, Portugal's from 1995, each news use counted ten times a
|
||
speech's) and word pairs (news only), left out spellings the 1990 spelling agreement retired and
|
||
plain spellings of a much commoner accented word, selected informative pairs and quantized
|
||
probabilities into HXTM v3. The capitalization list is the share of
|
||
each word the Brazilian counts write with a capital first letter. The validity list holds Brazil's
|
||
spellings outside the model and Portugal's own spellings from the Portuguese counts, each word's
|
||
count quantized to a cost. Hex's own chat words (such as vc, pra and tá) were written for Hex.
|