
Therefore, I thought, why not try one of the fancy language models that are talked about so much these days. Sometimes the item is mentioned three sentences before the price, or only alluded to. Carefully constructed regexes are usually closer to my mode of thinking than more opaque machine learning methods, but in this case it was pretty clear that there was no generally exploitable sentence structure to extract both the price and the item. Of course I didn’t want to manually go through all 98 snippets, so I thought about ways to extract the data I needed automatically. “Look,” Harry heard one of them saĪn English speaker reading this should be able to extract the item of value being talked about in this paragraph: Dragon liver for sixteen Sickles. Several boys of about Harry’s age had their noses pressed against a window with broomsticks in it. A plump woman outside an Apothecary was shaking her head as they passed, saying, “Dragon liver, sixteen Sickles an ounce, they’re mad.” A low, soft hooting came from a dark shop with a sign saying Eeylops Owl Emporium - Tawny, Screech, Barn, Brown, and Snowy. He turned his head in every direction as they walked up the street, trying to look at everything at once : the shops, the things outside them, the people doing their shopping. Julia > snippet(corpus, snippet_ranges) |> print ht more eyes. Then, I loaded all seven of them into a string: (In the end, I could have just googled anyway, and would have found the table on this page, but that would not have been as much fun!) Preparing the dataįirst of all, I downloaded the Harry Potter plain text corpora from and extracted them into a folder, deleting the attached list of characters.


HARRY POTTER QUICK QUOTES QUILLS HOW TO
However, I never got there because the more interesting part proved to be how to assemble the list of items of value in the first place, without manually going through all the books. My initial plan for this exercise was to extract all prices from the books and plot them over time (position in the books) or in a sorted bar graph on a logarithmic axis to related all the things you could buy in the wizarding world. For example, something relatively expensive in the first book (the wand) looks very cheap compared to later items (the fireworks). Rowling might have added more and more expensive things while she was writing, just to contrast them against previously introduced items. So I wanted to visualize how the value of items mentioned across the books develops over time, because my hypothesis was that J.K. I have sometimes wondered about how inconsistent the books really are in this point. We don’t know how much time or effort it takes to make a wand, but probably more than mass produced fireworks, and I hope the Weasleys would have been able to afford food and clothes equaling fireworks in value. For example, the Weasley family has only a single gold coin in their vault, while a wand costs seven Galleons, and special fireworks from the Weasley twins in the later books ten Galleons. Harry Potter and moneyĪnybody who has read the Harry Potter books has probably noticed how the monetary value of items in the wizarding world is a bit… inconsistent at times. Lockhart used a peacock-feather quill for book signings and giving out autographs generally he still has it ( OP23).ĭumbledore had a "handsome scarlet quill" on the desk in his office since it matched the colour of Fawkes' body feathers, it might have been a phoenix-feather quill ( OP37).Īn infamous quill is the one used by Dolores Umbridge during her detentions ( OP13).In this blog post, I’ll show how I used Julia and a GPT-3 model (via an online API) in an attempt to analyze the monetary value of items in the Harry Potter novels, and what I learned in the process.Scrivenshaft's Quill Shop sells pheasant-feather quills Hermione bought a black-and-gold one during the first Hogsmeade visit in her fifth year ( OP16).Mundungus attempted to charge the twins six Sickles for a bag of knarl quills, which they considered extortionate ( OP9).One Auror dictates to his quill ( OP7).Harry uses an eagle-feather quill ( GF2).Various kinds of feathers have been mentioned as being used for quill pens in the wizarding world.

In addition, specific kinds of quills may have spells placed on them, such as to prevent cheating during examns ( PS16) or to automatically provide correct answers ( OP31). Various birds' feathers may be used to create such quill pens, including magical birds. Members of the wizarding community use quill pens and parchment for writing rather than modern Muggle pens and paper.
