Block workspaceHow a chatbot works, by building one/15 min
Next word, in blocks
The task
Graded on four lines your program prints. Labels have to be spelled exactly as shown.
- Make word patterns called
patternswith a context of 1 word, and have them learn the patterns in the text in filepassage.txt. - Say
after she comesthen what the patterns guess followsshe. Sayhow surethen how sure they are, out of 100, aftershe. - Generate greedily. Set
wordtotheandlinetothe. Repeat 20 times: setwordto the guess afterword, then join it ontolinewith a space. Saygreedythenline. - Generate with randomness. The same 20 step loop, but with a random word after
wordat temperature 1 and top-p 1. Sayrandomthenline.
Run it three times and read the two generated lines each time. One of them changes and one does not, and the debrief is about why.
Sign in to start
Exercises need an account.
It is free. Log in or create one, and every attempt and pass is saved to your progress.