⭐ NEURAL NETWORK TEXT GENERATOR ⭐ ---------------------------------- ✨ WHAT IS THIS? This project is a simple AI text generator made entirely in Scratch! It uses a real neural network that learns from example sentences and tries to predict what word should come next. ---------------------------------- ⭐ TOKENS The AI treats each word as a "token". For example: "I like cats" I = 2 like = 4 cats = 5 These numbers allow the neural network to work with words. ---------------------------------- ✨ PREDICTING THE NEXT TOKEN The neural network looks at the previous 2 tokens and calculates the probability of every possible next token. For example: "I like ..." cats = 45% pizza = 40% dogs = 8% other = 7% The AI then chooses the next token based on these probabilities. ---------------------------------- ❤️ WHY DOES IT GIVE DIFFERENT ANSWERS? The AI doesn't always choose the token with the highest probability. Instead, it randomly chooses using the probabilities calculated by the neural network. This means it can generate different sentences each time! ---------------------------------- ⭐ HOW DOES IT LEARN? The neural network is trained using example sentences. It makes a prediction, compares it with the correct token, and adjusts its weights using backpropagation. After thousands of training steps, it learns which tokens are likely to follow other tokens. ---------------------------------- ✨ HOW IT WORKS Text -> Tokens -> Neural Network -> Next-token probabilities -> Choose a token -> Add it to the sentence -> Repeat! ---------------------------------- ⭐ VERSION 1.0 ⭐ This is the first working version! Future versions will have a larger vocabulary, more training data, temperature control, custom starting tokens, and more!
plz ❤️ and ⭐ comment what do you think... click space to generate a sentence #AI