Ruby-us Hagrid: Writing Harry Potter with Ruby
summary
Claims that Ruby writes a new Harry Potter automatically using basic NLP are demonstrated with concrete code and empirical results: plain text books tokenized into ~20k unique words, a hash of continuations, and n‑gram models (bi/tri/4‑gram) built in Ruby. Generation strategies—greedy, uniform random, and weighted random sampling—are compared, showing loops and garbage for greedy, gibberish for uniform, and convincing pastiche with tri/4‑grams; implementation fits in 20 lines of Ruby and sometimes reproduces near‑book phrases.
AI-written summary · about
chapters (10)
- 0:00Start
- 0:36Rubeus Hagrid Writing Harry Potter with Ruby
- 7:16Learning Stage
- 8:27Tokenization
- 10:31The Greedy Algorithm
- 14:12The Uniform Random Algorithm
- 16:34The Weighted Out Random Algorithm
- 25:08Pay Attention to Our Failures
- 25:59Finding a Good Metaphor for a Problem
- 27:44Graph Coloring
related talks
39mNatural Language Processing with Ruby
33mSyntax Isn't Everything: NLP for Rubyists
27mNatural Language Processing with Ruby
45mUsing Ruby to Generate Faster Ruby Code through Partial Evaluation
35mIntelligent Ruby: Getting Started with Machine Learning
29mJRuby on Elephants
46mPractical Machine Learning and Rails
27mFive machine learning techniques that you can use in your Ruby apps today By Benjamin Curtis Machine learning is everywhere these days
