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

  • Posted 1 month ago by msuvakov
  • 9 points
https://github.com/suvakov/chargraph
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!

2 comments

    Loading..
    Loading..