×
What's the Fairytale Hunt?
📚 Explore Story Texts by Similarity
Select a text section inside the sentence with your finger or mouse to use as a search to find similar passages from other fairy tale texts — using an in-browser embedding index and similarity search. Some text elements will award you points in the categories I've defined, common in fairy tales. Magical creatures are harder than you might think! You can add to your score by adding your own search terms to a "Yours" category.
🎯 Category Buckets
Higher scores are given for rarer items (there is a python script in the repo that weights the scores). These terms were originally seeded by looking at top unigram and bigrams, then added to during use and weighted with Claude's help. The icons were made with a glif.ai app that uses a Flux Lora for a medieval style and adds a label.
🧭 Selection Similarity via Embeddings
The similarity score under the text shows how "similar" a new text is to what you selected. This app uses a tiny embedding model, bge-micro, with Transformers.js from Huggingface. The index and similarity search in the browser are handled with client-vector-search, a node package.
📜 Text Sources and Caveats
The text is sourced from Project Gutenberg book fairy tales, processed into sentences and then classified for "descriptiveness" using a small trained custom spaCy model. The dataset was later reduced quite a bit to a very few authors (4!) for this demo app. There may still be duplicate stories (depending on the book collection) and there may also be lines that contain offensive text (racism, sexism, violence and gore) for today's readers. Fairy tales aren't sweet.