LmCast :: Stay tuned in

WangNet – 1.8 MB, zero-dependency Numberwang adjudication in 11 languages

Recorded: Sept. 15, 2026, 8:08 p.m.

Original Summarized

GitHub - GraafHenk/numberwang: A small neural network that decides whether a number is Numberwang. · GitHub

Skip to content

Navigation MenuSign inAppearance settingsPlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesCode QualityEnforce quality at mergeAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricingSearch/Sign inSign upAppearance settings

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

GraafHenk

/

numberwang

Public

Notifications
You must be signed in to change notification settings

Fork
0

Star
4

Code

Issues
0

Pull requests
0

Actions

Projects

Security and quality
0

Insights

Additional navigation options

Code

Issues

Pull requests

Actions

Projects

Security and quality

Insights

mainBranchesTagsGo to fileCodeOpen more actions menuLatest commit History5 Commits5 CommitsFolders and filesNameNameLast commit messageLast commit dateLICENSELICENSE  README.mdREADME.md  app.pyapp.py  model.jsonmodel.json  numberwang.pynumberwang.py  requirements.txtrequirements.txt  View all filesRepository files navigationREADMELicenseMore itemsNumberwang
A small neural network that decides whether a number is Numberwang.
The 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.
$ python3 numberwang.py 22
22... THAT'S NUMBERWANG! (confidence: 99.3%)

$ python3 numberwang.py "45 - 44"
45 - 44... That's Wangernumb! Rotate the board! (confidence: 100.0%)

$ python3 numberwang.py "hello how are you"
hello how are you... That's not even a number. It can never be Numberwang. (confidence: 100.0%)
Usage
git clone https://github.com/GraafHenk/numberwang
cd numberwang
python3 numberwang.py 22
Run it with no arguments for an interactive session:
$ python3 numberwang.py
Welcome to Numberwang! (ctrl-c to stop playing Numberwang)
> zweiundzwanzig
zweiundzwanzig... THAT'S NUMBERWANG! (confidence: 100.0%)
> shinty-six
shinty-six... That's not Numberwang. (confidence: 100.0%)
Requires Python 3.8 or newer. That's the only requirement.
In your own code
from numberwang import load_model, wang_probabilities

model = load_model("model.json")
probs = wang_probabilities(model, "forty-seven")
# [p_not_numberwang, p_numberwang, p_not_a_number, p_wangernumb]

verdict = max(range(4), key=probs.__getitem__)
The four verdicts

id
verdict

0
That's not Numberwang.

1
THAT'S NUMBERWANG!

2
That's not even a number. It can never be Numberwang.

3
That's Wangernumb!

What it accepts

input
behaviour

42, sixty-six, 12345
digits or words

zweiundzwanzig, veintidós, tweeëntwintig
eleven languages, accents optional

5*2, 96 divided by 2, twelve plus four
arithmetic, judged on the result

45 - 44, double four, eins
anything worth 1 or 44 rotates the board

-7, 4.5, £5, 50%, 9:30
negatives, decimals, currency, units, times

XLIV, twenty-third, 22nd
Roman numerals and ordinals

fortnight, vierendelen, september
words built on a number, judged as that number

achtneming, often, money
words that merely contain one are not numbers

shinty-six, twentington
fictional numbers are numbers too

bonjour, hello how are you
no numeric content — can never be Numberwang

A number's wangness is a property of the number, not the language it
is said in: four, vier, quatre and cuatro all get the same verdict.
How it works
chars → Embedding(32) → Conv1d(128, k3) → ReLU
→ Conv1d(128, k3) → ReLU → global max pool
→ Linear(128) → ReLU → Linear(4) → softmax

80,804 parameters. The network reads characters directly — there is no
tokenizer, no normalizer and no rules engine at inference. Digits,
operators, canon verdicts and the eleven languages are all held in the
weights, and model.json contains the lot.
Demo
A hosted version runs on Hugging Face Spaces. To run the same demo
locally:
pip install -r requirements.txt
python3 app.py
gradio is needed only for the demo. The model itself never needs it.
Accuracy
88.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.

class
precision
recall
F1

not Numberwang
0.820
0.885
0.851

Numberwang
0.919
0.900
0.910

not a number
0.951
0.830
0.886

Wangernumb
0.968
0.909
0.937

Arithmetic on unseen operands is the weak spot, at 44–72%. The
network memorises rather than computes, so small common expressions like
5*2 are reliable while 904 * 3 is an educated guess. If arithmetic
correctness matters, evaluate the expression and hand it the result.
License
MIT — see LICENSE.
No warranty is expressed or implied as to whether any particular number
is, or is not, Numberwang.
AboutA small neural network that decides whether a number is Numberwang.ResourcesReadmeLicenseActivityStars4 starsWatchers0 watchingForks0 forksReport repositoryReleasesPackagesContributorsLanguages

Footer

© 2026 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

A small neural network has been developed that functions to determine whether a given number is classified as Numberwang. The entire model is encapsulated within a 1.8 megabyte JSON file, and the inference process is implemented using pure Python standard library functions, requiring no external machine learning frameworks like PyTorch or NumPy for execution. This approach allows for direct cloning and running of the model.

The system is designed to handle a broad and complex range of input behaviors. It accepts inputs ranging from simple integers and digits to complex linguistic expressions, including words from up to eleven languages with optional accents, Roman numerals, and multi-operand arithmetic calculations. For example, it can evaluate expressions like 45 minus 44, or handle linguistic inputs such as "zweiundzwanzig," while explicitly rejecting inputs that contain no numeric content, such as conversational phrases like "hello how are you." The core principle established is that the wangness of a number is an intrinsic property, independent of the language used to express it.

The architecture of the network processes character inputs through an embedded layer followed by one or more one-dimensional convolutional layers with a kernel size of three and ReLU activation functions. This is followed by global max pooling and linear layers, culminating in four final output nodes activated by a softmax function to produce the required verdicts. The entire structure contains 80,804 parameters, with the weights for digits, operators, canonical verdicts, and the eleven languages intrinsically encoded within the model weights and the model file.

The network's operational capacity is demonstrated by its classification system, which provides four distinct verdicts: That's not Numberwang, THAT'S NUMBERWANG, That's not even a number, and That's Wangernumb. Performance evaluation on 486 held-out adjudications indicates an overall accuracy of 88.9 percent, corresponding to a macro-F1 score of 0.896, against a theoretical ceiling of approximately 98 percent, with a notable observation that about two percent of the training labels were inverted, reflecting established adjudication practices.

The model exhibits performance differentials across the classes. For instance, the recall for identifying "Numberwang" is 0.900, and the precision is 0.919. The network shows a particularly high degree of certainty in classifying inputs as "not a number," achieving a recall of 0.830. A known limitation identified is the handling of arithmetic operations on operands that were not present in the training set, where uncertainty arises for calculations involving numbers between 44 and 72 percent. This suggests that while the network excels at pattern recognition based on linguistic and numerical forms, its capacity for computing unseen arithmetic relies more on memorization than true computation. The system is provided with specific guidance regarding this limitation, advising users to evaluate and provide the result for expressions if arithmetic correctness is paramount. The repository is licensed under the MIT License, and the developer explicitly disclaims any warranty regarding the absolute veracity of any single number's classification.