hex/android/benchmark/typing/pt-inputs.tsv
Ryan Vogel 0add67e372 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).
2026-11-24 18:10:17 -05:00

21 lines
4.9 KiB
Text

# Portuguese typing model inputs (build-layout-model.py pt), each fetched once and checked
# against its size and SHA-256 before it is read. name<TAB>URL<TAB>fetched<TAB>bytes<TAB>SHA-256<TAB>licence
# The Leipzig files are the collection's downloadable corpora, never its website or API (CC BY-NC).
# The two ParlaIbero CSVs are Harvard Dataverse files 14215092 and 14215091 (MD5 53bc8b49…109e and
# 41218de9…1f05 as Dataverse lists them).
por-br_newscrawl_2011_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por-br_newscrawl_2011_1M.tar.gz 2026-11-24 203913314 c475fc95216aebc1a67ba68df106431a99c1419ab227f2daa06ded0042dbae1f Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_news_2019_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_news_2019_1M.tar.gz 2026-11-24 255233335 8a3fa261ab8770fffd10a7b1e258af758bceddaa45e1e3c4db9e6a0ce281d253 Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_news_2020_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_news_2020_1M.tar.gz 2026-11-24 257037716 a16196fbada20f3caa3b16a9a2adf4dffbcfad22d717b4b48b1a3d5f66669bc6 Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_news_2022_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_news_2022_1M.tar.gz 2026-11-24 261345429 0790deb8e6e987b2b8760bbfb58f8c81d7450bc605251c574d9f0985e63d420d Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_news_2023_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_news_2023_1M.tar.gz 2026-11-24 264635963 aed65cdbbfa66521c1ba12fe6d6fe66dda820940c6f537d1d7a39fd0d2880573 Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_news_2024_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_news_2024_1M.tar.gz 2026-11-24 265333698 cc8560f85eeea797ed9ddd5e8d3b8a3db5daea694f4b8272e20be8622c6ed865 Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_newscrawl_2011_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_newscrawl_2011_1M.tar.gz 2026-11-24 193103780 eed509ebc8e4d286f041162fc19a4ec7f0f75182c0f3df42dda7d0148ab579a7 Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_newscrawl_2015_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_newscrawl_2015_1M.tar.gz 2026-11-24 253984467 5c35c98675b0cac06088da394ccfd9ca430a3596a62e76b5db20ae37dd77b81f Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_newscrawl_2016_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_newscrawl_2016_1M.tar.gz 2026-11-24 253377525 3ddda51f6709879944a7980c52b4d825eab5d7e4ba05c69506dc62e72e5fdd4c Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_newscrawl_2018_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_newscrawl_2018_1M.tar.gz 2026-11-24 255852777 a060739d8060ffcf391fc0aaaddc2a148300de71fd66d7c0642e422b0336b110 Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por_newscrawl_2020_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por_newscrawl_2020_1M.tar.gz 2026-11-24 268434695 4aa0a1bef4e7524bad024d67c9ae3e449fa03550985d0707c2d3a037c2bf196b Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por-pt_newscrawl_2011_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por-pt_newscrawl_2011_1M.tar.gz 2026-11-24 241962491 3ff73a934ca4c35b27e106d725bab12cfdf8b54ef08d46331cb7e1fc7133f25a Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por-pt_web_2014_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por-pt_web_2014_1M.tar.gz 2026-11-24 254603893 7ff4e8966138b5ea3832378b846f989e536d92e2d27ada1ab38133e91219c146 Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
por-pt_web_2015_1M.tar.gz https://downloads.wortschatz-leipzig.de/corpora/por-pt_web_2015_1M.tar.gz 2026-11-24 265546940 362960b9176f6a1185aa86d5ee642b3e644c05df5181c810754be50af70d504a Leipzig Corpora Collection download, CC BY 4.0 (downloads only; https://wortschatz-leipzig.de/en/usage)
BR_interventions.csv https://dataverse.harvard.edu/api/access/datafile/14215092 2026-11-24 1527460901 a2371495c5d2096f052e185e88ee02fd151e427d8b159bbcff213063c8775078 ParlaIbero-BR v2, Rodrigues-Silveira 2026, doi:10.7910/DVN/VTXNW3, CC BY 4.0
PT_interventions.csv https://dataverse.harvard.edu/api/access/datafile/14215091 2026-11-24 1199719582 2acd628564da99eafeb3b076e6d554a3d4a30b3d2f3d387598f63b151f203392 ParlaIbero-PT v2, Rodrigues-Silveira 2026, doi:10.7910/DVN/VRPUFU, CC BY 4.0