{"slug": "wangnet-1-8-mb-zero-dependency-numberwang-adjudication-in-11-languages", "title": "WangNet – 1.8 MB, zero-dependency Numberwang adjudication in 11 languages", "summary": "Developer GraafHenk released WangNet, a 1.8 MB JSON neural network with roughly 100 lines of pure Python standard-library inference code that adjudicates whether a number is Numberwang across 11 languages, requiring only Python 3.8 or newer. The 80,804-parameter character-level model scores 88.9% over 486 held-out adjudications (macro-F1 0.896) against a ceiling of roughly 98%, with arithmetic on unseen operands its weak spot at 44–72%. The project is MIT-licensed and also runs as a hosted demo on Hugging Face Spaces.", "body_md": "A small neural network that decides whether a number is Numberwang.\n\nThe whole model is a 1.8 MB JSON file and the inference code is about 100 lines of pure Python standard library — no PyTorch, no NumPy, nothing to install. Clone it and run it.\n\n``` bash\n$ python3 numberwang.py 22\n22... THAT'S NUMBERWANG!  (confidence: 99.3%)\n\n$ python3 numberwang.py \"45 - 44\"\n45 - 44... That's Wangernumb! Rotate the board!  (confidence: 100.0%)\n\n$ python3 numberwang.py \"hello how are you\"\nhello how are you... That's not even a number. It can never be Numberwang.  (confidence: 100.0%)\ngit clone https://github.com/GraafHenk/numberwang\ncd numberwang\npython3 numberwang.py 22\n```\n\nRun it with no arguments for an interactive session:\n\n``` bash\n$ python3 numberwang.py\nWelcome to Numberwang! (ctrl-c to stop playing Numberwang)\n> zweiundzwanzig\nzweiundzwanzig... THAT'S NUMBERWANG!  (confidence: 100.0%)\n> shinty-six\nshinty-six... That's not Numberwang.  (confidence: 100.0%)\n```\n\nRequires Python 3.8 or newer. That's the only requirement.\n\n``` python\nfrom numberwang import load_model, wang_probabilities\n\nmodel = load_model(\"model.json\")\nprobs = wang_probabilities(model, \"forty-seven\")\n# [p_not_numberwang, p_numberwang, p_not_a_number, p_wangernumb]\n\nverdict = max(range(4), key=probs.__getitem__)\n```\n\n| id | verdict | \n|---|---|\n| 0 | That's not Numberwang. | \n| 1 | THAT'S NUMBERWANG! | \n| 2 | That's not even a number. It can never be Numberwang. | \n| 3 | That's Wangernumb! | \n\n| input | behaviour | \n|---|---|\n| `42` ,`sixty-six` ,`12345` | digits or words | \n| `zweiundzwanzig` ,`veintidós` ,`tweeëntwintig` | eleven languages, accents optional | \n| `5*2` ,`96 divided by 2` ,`twelve plus four` | arithmetic, judged on the result | \n| `45 - 44` ,`double four` ,`eins` | anything worth 1 or 44 rotates the board | \n| `-7` ,`4.5` ,`£5` ,`50%` ,`9:30` | negatives, decimals, currency, units, times | \n| `XLIV` ,`twenty-third` ,`22nd` | Roman numerals and ordinals | \n| `fortnight` ,`vierendelen` ,`september` | words built on a number, judged as that number | \n| `achtneming` ,`often` ,`money` | words that merely contain one are not numbers | \n| `shinty-six` ,`twentington` | fictional numbers are numbers too | \n| `bonjour` ,`hello how are you` | no numeric content — can never be Numberwang | \n\nA number's wangness is a property of the **number**, not the language it\nis said in: `four`, `vier`, `quatre` and `cuatro` all get the same verdict.\n\n```\nchars → Embedding(32) → Conv1d(128, k3) → ReLU\n      → Conv1d(128, k3) → ReLU → global max pool\n      → Linear(128) → ReLU → Linear(4) → softmax\n```\n\n80,804 parameters. The network reads characters directly — there is no\ntokenizer, no normalizer and no rules engine at inference. Digits,\noperators, canon verdicts and the eleven languages are all held in the\nweights, and `model.json` contains the lot.\n\nA hosted version runs on Hugging Face Spaces. To run the same demo locally:\n\n```\npip install -r requirements.txt\npython3 app.py\n```\n\n`gradio` is needed only for the demo. The model itself never needs it.\n\n88.9% over 486 held-out adjudications (macro-F1 0.896), against a ceiling of roughly 98% — about 2% of training labels are inverted, in accordance with long-standing adjudication practice.\n\n| class | precision | recall | F1 | \n|---|---|---|---|\n| not Numberwang | 0.820 | 0.885 | 0.851 | \n| Numberwang | 0.919 | 0.900 | 0.910 | \n| not a number | 0.951 | 0.830 | 0.886 | \n| Wangernumb | 0.968 | 0.909 | 0.937 | \n\n**Arithmetic on unseen operands is the weak spot**, at 44–72%. The\nnetwork memorises rather than computes, so small common expressions like\n`5*2` are reliable while `904 * 3` is an educated guess. If arithmetic\ncorrectness matters, evaluate the expression and hand it the result.\n\nMIT — see [LICENSE](https://github.com/GraafHenk/numberwang/blob/main/LICENSE).\n\n*No warranty is expressed or implied as to whether any particular number\nis, or is not, Numberwang.*", "url": "https://wpnews.pro/news/wangnet-1-8-mb-zero-dependency-numberwang-adjudication-in-11-languages", "canonical_source": "https://github.com/GraafHenk/numberwang", "published_at": "2026-09-15 19:27:35+00:00", "updated_at": "2026-09-15 19:49:51.152491+00:00", "lang": "en", "topics": ["neural-networks", "machine-learning", "ai-tools", "developer-tools"], "entities": ["WangNet", "GraafHenk", "GitHub", "Hugging Face Spaces", "Python", "Numberwang"], "alternates": {"html": "https://wpnews.pro/news/wangnet-1-8-mb-zero-dependency-numberwang-adjudication-in-11-languages", "markdown": "https://wpnews.pro/news/wangnet-1-8-mb-zero-dependency-numberwang-adjudication-in-11-languages.md", "text": "https://wpnews.pro/news/wangnet-1-8-mb-zero-dependency-numberwang-adjudication-in-11-languages.txt", "jsonld": "https://wpnews.pro/news/wangnet-1-8-mb-zero-dependency-numberwang-adjudication-in-11-languages.jsonld"}}