The tldr bot is pulling directly from the article - it used to use ChatGPT wayy back when it was originally created, but it got expensive for the creator, so now I believe it uses some sentence interpreter library to compare relevance of paragraphs, in combination with semantic HTML tags/markup.