Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf 2018 - Ruby-us Hagrid: Writing Harry Potter with Ruby by Alex Peattie We all know that Ruby can give us super powers, but can we use it do something truly magical - write a brand new Harry Potter completely automatically? It turns out that Ruby and the dark arts of Natural Language Programming are a match made in heaven! Using some basic NLP techniques, a dash of probability, and a few lines of simple Ruby code, we can create a virtual author capable of generating a very convincing Potter pastiche. And if the life of an author’s not for you, don’t worry. In the last part of the talk, we'll explore how we can apply what we've learnt to everyday coding problems.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
### Introduction In the talk titled "Ruby-us Hagrid: Writing Harry Potter with Ruby," Alex Peattie explores the fascinating premise of using the Ruby programming language to automatically generate new Harry Potter stories. This unique intersection of programming and literature serves as a gateway to understanding Natural Language Processing (NLP) while showcasing Ruby's capabilities. ### Key Points - **Motivation for the Project**: - Fans of Harry Potter may desire new content to immerse themselves in the Wizarding World. - For developers, creating such content could yield financial rewards, given the vast interest in Harry Potter. - **Understanding Natural Language Processing**: - The talk introduces NLP as a crucial element in generating text that mimics a particular author’s style. - The process begins by learning about a corpus, in this case, the Harry Potter books, to capture the linguistic style of J.K. Rowling. - **Creating a Virtual Author**: - Peattie emphasizes focusing on generating one word at a time, reminiscent of how predictive text works on smartphones. - He details two phases of development: the learning phase (gathering statistical data on word usage) and the generation phase (using that data to concoct new narratives). - **Algorithmic Approaches**: - **Learning Phase**: - By analyzing text, they collect data on head words and their continuations to form a statistical model. - **Generating Text**: - The presentation discusses various algorithms: - **Greedy Algorithm**: Selects the most frequently occurring next word but can lead to repetitive loops. - **Uniform Random Algorithm**: Chooses words at random but may not faithfully represent the original style. - **Weighted Random Algorithm**: Offers a better approximation for mimicking Rowling's writing by sampling words based on their actual frequencies, improving narrative cohesion. - **Failure as a Learning Tool**: - Peattie emphasizes the importance of analyzing failures during algorithm testing to improve the output quality. - Metaphors can aid in grasping complex problems and devise more effective solutions. ### Takeaways - Tackling programming challenges involves understanding motivations, dissecting failures, and applying learned lessons in novel ways. - The exploration of algorithms demonstrates how different methodologies can affect the quality of text generation, guiding developers in their approach to NLP tasks. - The project encapsulates the intersection of technology and creativity, transforming simple programming tasks into quests for narrative artistry, all while using the elegant syntax of Ruby.
Suggest modifications
Cancel