hex/ios/docs/acknowledgements.md
Ryan Vogel f5819f4c4c
English typing model: names, days, places and newer words (Claude, Monday, ChatGPT) (#2973)
* English typing model: SCOWL's names, days and places join the words

The English builder kept only the spellings SCOWL writes in lowercase, so
en.hextm (iPhone and Android, byte-identical) had no names at all. Swipe reads
only model words, so "Claude" (reported on X), "Monday", "Mary", "London" and
"Christmas" could never be swiped ("clause", "noonday", "marry", "kingdom",
"christenings"), and typos of them were never corrected to them. 4.84% of the
held-out sentences' words were such names; the swipe benchmark skipped them.

- build-typing-model.py (both copies): SCOWL's upper and proper-names lists
  (sizes <= 70) join, each word spelled with one capital first, 3+ letters, in
  lowercase, ranked by its Google Books count. MAX_WORDS en 90,000 -> 100,000,
  whose 400,000-word pool keeps every earlier word (90,000 would drop 8,379).
  en.hextm: 86,247 -> 100,110 words, 417,182 -> 371,883 pairs, same
  3,599,995 bytes. en.capitals (20,464 words) and en.valid rebuilt.
- The 589 bigram shards (323.8 GB) were re-read once over a superset of words;
  with the old rules those counts rebuild c23e9c54 and the old en.capitals and
  en.valid byte for byte. New model b5e83bc1, rebuilt again from the committed
  builder.
- A name the decoder corrects to takes its capital on both platforms
  ("mray" -> "Mary"): TypingWord (Android) and AutocorrectEngine (iOS) now
  capitalise English corrections as they did German's.
- Swipe: English drops the 4-nat rare-name cost (Android SwipeReader.ranked,
  iPhone SwipeTyping.ranked). It existed for the lowercase list's accidental
  names ("kent", "gs"); with real names at real counts it kept "Claude" behind
  "clause" half the time. Removed behavior: English rare names are no longer
  ranked 4 nats lower; other languages keep it. The iPhone test asserting that
  ranking now asserts decoder order for English.
- swipe-bench.py/SwipeReplay --outside: the 208 held-out words (666 swipes)
  1.0.5's model lacked are swiped and scored apart (swipe-outside-en.txt).

Verified (Android host JVM, Studio): quality-gate en 680 -> 583 word errors
(85.50% -> 87.57%), correct words changed 45 -> 48 (Adriano->Adrian x2,
Edmundo->Edmund x2, Liisa->Lisa; Gabor, Fadil now kept), critical 2/2.
Swipe old set typical 96.9 -> 96.8, neat 99.0 -> 99.0, sloppy 82.0 -> 81.4
(first word); the 666 lacked: 0 -> 54.2 / 55.9 / 44.4. Claude vs clause
(20 neat / 20 typical): 20/18 first, clause 20/20. Known trade: a swiped
"marry" gives "Mary" without a word before ("to marry": marry 19/20).
Android unit tests: 399 passed. iPhone gate and suite: pending (simboxes
blocked by Studio swap).

* English typing model: spellings beside the model, and newer words from the news

The model is lowercase and the capitals mechanisms give only a first capital
("Mary"), so "iPhone", "GitHub" or "ChatGPT" had no way to come out right, and
words newer than Google Books (1980-2019) were missing: a swiped "chatgpt"
read "chatbot", "openai" "penal", "iphone" "uphold".

- en.spellings (new, beside en.hextm on both platforms, byte-identical; 299
  lines, 4.6 KB): word<TAB>spelling, sorted by UTF-8 bytes, read in place on
  Android (Capitals.kt Spellings, TypingModel) and iPhone (HexWordList.text,
  AutocorrectEngine+Spellings). A listed word takes its spelling typed in
  lowercase, corrected to, swiped and in the strip; the iPhone strip also shows
  names with their capital. Android dictation keeps Whisper's capitals for
  listed words (KeyboardEngine, Whisper/SentenceEnds).
- build-typing-model.py (both copies): SCOWL's spellings with a capital inside
  that aren't acronyms join with the names (115 in the model: "iPhone",
  "PayPal"); then, after pairs are counted, words the vocabulary lacks from
  the Leipzig Corpora Collection's 2023-2025 English news (CC BY 4.0, pinned
  by URL, date, size, SHA-256 in ENGLISH_NEWS) that 100+ news sites use, 4+
  letters, not acronyms: 243 ("ChatGPT", "OpenAI", "TikTok", "offline"), at
  the count their news share stands for. Hex's own chat words keep no
  spelling ("wifi"). en-extra-words.tsv's "no brand names" rule is replaced.
- Credits: Android credits.txt, iPhone Acknowledgements and its doc.
- Removed behavior: "github" typed without your own words now becomes
  "GitHub" (the model's spelling); NeverSuggestTest expects that.

Why 4 letters: with 3, the news added "Eid", "Isa", "Ole", which took "did"
(x2), "is a" (x2) and "Oleg" (x3) in the gate.

Verified (Android host JVM, Studio): quality-gate en 583 -> 582 word errors
(87.59% fewer than raw taps; 680 before the PR), correct words changed
48 -> 48, critical 2/2. Swipe old set typical/neat/sloppy 96.8/99.0/81.4
(unchanged), the 666 1.0.5 lacked 54.2 -> 54.7 typical. ChatGPT, OpenAI,
GitHub, iPhone 20/20 neat and typical, YouTube 20/19. en.hextm f503d6d1 and
en.spellings 4d244e9b rebuilt from the committed builder. Android unit tests
399 passed. iPhone: build-for-testing succeeds on the Studio; gate and suite
pending (simboxes blocked by Studio swap).

* English typing model: names and newer words need four letters

The iPhone suite on the branch failed testThisIsATestSwipedWithASingleLetterBetween:
an "a" dragged a little too far and back typed "asa". A slid tap reads a word
that starts and ends on its key ("lol" on l), and SCOWL's three-letter names
added such words ("Asa", "Ada", "Ava", "Nan", "Ede"). Three-letter names also
took ordinary words in sloppy swipes ("the" -> "Tyr", "is" -> "Ira"), as
three-letter news words did in the gate ("did" -> "Eid").

- build-typing-model.py (both copies): NAME_LETTERS = 4 for SCOWL's names and
  the news words alike (replaces NEWS_LETTERS). Removed behavior: 138
  three-letter names ("Joe", "Amy", "Jan", "Aug") are no longer model words,
  so they can't be swiped; typed, they keep the capital en.capitals or the
  phone's dictionary gives them, as in 1.0.5. Spellings with a capital inside
  keep three letters ("iOS", "PhD").
- en.hextm 98c8da8f (100,357 words, 370,951 pairs, 3,599,997 bytes),
  en.capitals and en.valid rebuilt from the committed builder; en.spellings
  unchanged (4d244e9b).

Verified: Android quality-gate en 582 -> 582 word errors, 48 changed (680 and
45 before the PR); swipe old set typical/neat/sloppy 96.8/99.0/81.4 ->
96.9/99.0/81.7, the 666 1.0.5 lacked 54.7 -> 54.4 typical; Claude vs clause
20/18 of 20 unchanged; with no name penalty the old set now loses 0 typical
and 25 sloppy swipes (was 9 and 40). Android unit tests 399 passed.
iPhone (simbox, iPhone 18 Pro): typing-gate en 735 (1.0.5 model) -> 633 word
errors, 37 -> 35 changed, names capitalised 418 -> 421; full suite 1014
tests, 0 failures, 5 skipped (it failed 1 before this commit).
2026-11-27 12:27:16 -05:00

71 lines
5.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Acknowledgements
Part of [Hex for iPhone](../README.md).
The app shows these under Settings › Acknowledgements (`HEXMobile/AcknowledgementsView.swift`).
- **Google Books Ngram data:** Spatial autocorrect's word and word-pair frequencies,
German's capitalisation shares and French's list of words outside its model come from the Google Books Ngram Viewer data, version 3
(2020), by Google, licensed under
[Creative Commons Attribution 3.0](https://creativecommons.org/licenses/by/3.0/). Counts
are summed over 1980–2019 and kept only for words in the lists below.
- **SCOWL:** English words are checked against SCOWL (Spell Checker Oriented Word Lists)
and VarCon by Kevin Atkinson, sizes up to 70 (<http://wordlist.aspell.net/>). Copyright
2000-2018 by Kevin Atkinson. Permission to use, copy, modify, distribute and sell these
word lists, the associated scripts, the output created from the scripts, and its
documentation for any purpose is hereby granted without fee, provided that the above
copyright notice appears in all copies and that both that copyright notice and this
permission notice appear in supporting documentation. Kevin Atkinson makes no
representations about the suitability of this array for any purpose. It is provided
"as is" without express or implied warranty. SCOWL's inflections come from WordNet 1.6,
Copyright 1997 by Princeton University, all rights reserved, provided "as is" without
warranties (the full notice is in the app); its other sources are public domain.
- **Leipzig Corpora Collection:** English words newer than the books and their spellings
("ChatGPT", "TikTok") come from the [Leipzig Corpora Collection](https://wortschatz-leipzig.de/en/download)'s
English news downloads for 2023, 2024 and 2025, Leipzig University and the Saxon Academy
of Sciences and Humanities in Leipzig (D. Goldhahn, T. Eckart and U. Quasthoff, LREC 2012),
licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/).
Hex keeps only word counts, how many sites use each word and its spellings.
- **LDNOOBW:** The keyboard's suggestion filter uses the
[List of Dirty, Naughty, Obscene, and Otherwise Bad Words](https://github.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/tree/5faf2ba42d7b1c0977169ec3611df25a3c08eb13)
(LDNOOBW), © 2012–2020 Shutterstock, Inc., and contributors: its English, Spanish,
German and Norwegian lists, licensed under
[Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/).
Hex lowercased and classified the entries, omitted ordinary, medical and search-only
terms, and added common slurs, inflections and spelling variants.
- **Parakeet V2:** Hex dictates English with NVIDIA's
[Parakeet TDT 0.6B v2](https://huggingface.co/nvidia/parakeet-tdt-0.6b-v2), licensed under
[Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/),
downloaded as FluidInference's
[Core ML conversion](https://huggingface.co/FluidInference/parakeet-tdt-0.6b-v2-coreml)
(CC BY 4.0, encoder weights at reduced precision), used unchanged.
- **Parakeet Ultra:** Settings › Dictation › Model: Multilingual downloads
[Parakeet Ultra](https://huggingface.co/moondream/parakeet-ultra) by Moondream, a
post-training of NVIDIA's
[Parakeet TDT 0.6B v3](https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3), both licensed
under [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/),
as FluidInference's [Core ML conversion](https://huggingface.co/FluidInference/parakeet-ultra-coreml)
(revision `95eaa59`: 8-bit integer encoder weights, decoder and joint re-exported), used
unchanged.
- **RLA-ES:** Spanish words are checked against RLA-ES, the Spanish spelling dictionaries
for LibreOffice by Santiago Bosio and contributors (Spain and Mexico), used under the
[Mozilla Public License 1.1](https://www.mozilla.org/en-US/MPL/1.1/)
(<https://github.com/sbosio/rla-es>).
Polish's three entries show while the keyboard bundles `pl.hextm`
(`AcknowledgementsView.polishEntries`):
- **National Corpus of Polish n-grams:** Polish word and word-pair frequencies come from
the n-grams of NKJP's balanced subcorpus (Institute of Computer Science, Polish Academy
of Sciences; <http://zil.ipipan.waw.pl/NKJPNGrams>), made available under a
[Creative Commons Attribution](https://creativecommons.org/licenses/by/) licence (the page
names no version).
- **ParlaMint:** which Polish spellings are missing their marks, and which words are names, is
checked against the Polish part of ParlaMint 5.0 (Erjavec et al., CLARIN.SI, <http://hdl.handle.net/11356/2004>),
licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
- **PoliMorf:** Polish words are checked against PoliMorf 2018-07-23
(<http://hdl.handle.net/11321/577>), under the 2-clause BSD licence whose notice the app
reproduces in full: portions copyright © 2011 Marek Futrega, Piotr Gackiewicz, Mirosław
Prywata, Włodzimierz Macewicz, Marcin Miłkowski; © 2007–2018 Zygmunt Saloni, Włodzimierz
Gruszczyński, Marcin Woliński, Robert Wołosz, Danuta Skowrońska; © 2011–2018 Institute of
Computer Science, Polish Academy of Sciences.