WordPlay

bidirectional character n-gram language models for word generation and Hangman word guessing challenge

WordPlay model, built from bidirectional character n-grams, is shown with two fun use cases. The trainings and codes are available in the LexiNet repository.

Word guessing

WordGuesser plays a Hangman-style challenge by ranking the next most likely letter,

In this version of Hangman, you choose the secret word and decide how many wrong guesses the model is allowed. The model begins with a row of blank positions, scores every unguessed letter using the visible forward and reverse character contexts, selects its strongest candidate, and reveals every matching position. A miss costs one life; the game ends when the word is complete or the configured lives run out.

WordGuesser
Let the model guess your word
Enter one English word and choose how forgiving you want the game to be.
Preparing model...

Word generation

WordGenerator samples entirely new English-like words from the learned character patterns.

Ever wondered English has so many words that you hear for the first time, and you wonder how do they even exist, and why haven’t I heard about it ever before? kibosh, svengali, chicanery, bulwark, clandestine, and so on..

This discovery of new words does not stop even after memorizing all the vocabulary words for the toefl, it goes on and on. It seems like there is some magical power in this language with the potential to make up new words, assign them a meaning, and wait for them to get popularized. This idea to potentially make up new words is not a novel idea at all, history is witness to so many words being brought into the popular culture for more than the last half milennia… more increasingly now than ever in the information age.

The wordplay model is fueling that increasing surge, only for your curiosity. How many letters do you want in the english word that wordplay will generate for you? Let the model know. How strangely new do you want the word to be? Let the model know, with the temperature parameter. High temp (>0.8) means so strange, zero temp means no strange.

WordGenerator: unravel some discoveries for yourself
Generate your new English word!
Choose a length and let the trained n-gram tables sample plausible character sequences.
Preparing model...

What might these new words be useful for

Maybe you can these new generated words as the name for the secret incorporation idea that you have had since ages.

About this trained model: it is very simple and intuitive actually

The patterns that you observe in the words generated by the models arise having been trained on a dataset of 227,000 english words.

One might be so bold to call these words hallucinations! Hah, it is not incorrect to say that. Of all these patterns that are being learned this generation, the very premise of finding new words that were not trained on, that is, seen before in the training set, would surface in between the probability distributions, known in the pop culture as hallucinations.

LexiNet is a character-level modeling project built around bidirectional n-gram language models. The repository trains forward and reverse models with start/end padding, masked contexts, interpolation, backoff, and smoothing.

What is happening here?: a technical note for the demos

The guessing game is deterministic and greedy. Given the visible pattern, it scores every unguessed letter across all blank positions using forward and reverse context probabilities, guesses the highest-scoring letter, reveals its matches, and loses one configured life only when the letter is absent.

The generator begins with a blank word of the requested length. At every step, it scores candidates letters at every remaining blank position using the trained forward and and reverse n-gram contexts, samples one (position, letter) pair, fills that slot, and repeats until the word is complete. Lower temeperatures make the generation more conservative; higher temperatures make it more exploratory.

This is not dictionary lookup; it is probabilistic generation. Both demos operate from learned character-context counts, and the generator is explicitly searching for strings that can emerge between those observed patterns.

Both boxes run entirely in the browser and share one cached JSON export of the trained n-gram count tables. The interface is separated so normal project text can sit between the demos, while the large model artifact is downloaded only once. The public model includes orders n=3 through n=6 and automatically uses the strongest suitable order for the requested word length.