--- Instructions --- 1. Turn on turbo mode (Shift Green Flag) 2. Click the green flag 3. Click the screen to start the AI session 4. Type some text into the text box and then hit send to watch the AI generate! This is a Large (sort of) Language Model built entirely in Scratch. Trained on over 13,000 words in 160 paragraphs, NexGram uses the 4-gram Markov Chain architecture to predict words and sentences based on patterns in the training data. This allows it to create original sentences about multiple topics, and sometimes when it crosses between training data sets, it can turn out to be pretty funny, such as when it told me, "The sun is actually a medium-sized star, and it always got you home exactly when dinner was ready." Occasionally it will print out text that is literally the training data, so if something seems very cohesive, it's probably the training data.
One thing to be aware of: I still don't know how to detect backspace, so to delete a letter, press the left arrow key. Special thanks to Python for the heavy-duty data preprocessing and cleaning before importing the tokens into Scratch. Also thanks to Google's Gemini model for generating all of my training data. #tools #ai #llm #machine-learning #ngram #markov-chain