Show HN: Throw a Whole Book into an LLM to Extract Characters and Relationships

Let's try a small experiment with LLMs that have a large context length: feed an entire book into the context window and ask it to generate a list of characters, their relationships, and physical descriptions—data that can later be used for image generation.

In this repository, you can find two tools: a script that extracts data from book text using an LLM (Gemini or OpenRouter API) and an HTML/JS (D3) visualization of the character graph. An external text-to-image model can be used to generate character illustrations (a Google Colab example is provided).

Explore the visualizations, play with the script, and feel free to add more books to the repo via pull requests!

9 points msuvakov 1 year ago 4 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton