TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Robust LLM Extractor for HTML/Markdown in TypeScript

14 pointsby andrew_zhong10 days ago
While working with LLMs for structured web data extraction, we saw issues with invalid JSON and broken links in the output. This led me to build a library focused on robust extraction and enrichment:<p>- Clean HTML conversion: transforms HTML into LLM-friendly markdown with an option to extract just the main content - LLM structured output: Uses Gemini 2.5 flash or GPT-4o mini to balance accuracy and cost. Can also also use custom prompt - JSON sanitization: If the LLM structured output fails or doesn&#x27;t fully match your schema, a sanitization process attempts to recover and fix the data, especially useful for deeply nested objects and arrays - URL validation: all extracted URLs are validated - handling relative URLs, removing invalid ones, and repairing markdown-escaped links<p>I&#x27;d love to hear if anyone else has experimented with LLMs for data extraction or if you have any questions about this approach!

no comments

no comments