> Web scraping is usually pretty tedious, but I found that I could send the minimised HTML to GPT-3 and get (almost) perfect JSON back: the prompt includes the Typescript definition. Could you share the prompt? Or, if OP can't share, does anyone have ideas for a prompt to do something like this?
Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT
171–177 of 177 posts
Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT
#172> Web scraping is usually pretty tedious, but I found that I could send the minimised HTML to GPT-3 and get (almost) perfect JSON back: the prompt includes the Typescript definition. Could you share the prompt? Or, if OP can't share, does anyone have ideas for a prompt to do something like this?
The prompt is probably simple, but the bigger challenge is that even a minified html of a typical web page would be more than the 4k gpt token limit
Then convert that to Markdown, which GPT groks happily, and it preserves the right balance of discarding meaningless structure but preserving some semantics (italics, headings, etc).
The best tool I've found for that process is aaronsw's html2text, amazing that it's still so valuable after all these years.
Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT
#173I wonder what the standard approach is when the LLM does not return valid JSON data? Do you skip the input data all together, or use the parsing error to generate a valid JSON?
A parse error kicks off a recovery process where, in theory, we could run any number of rules. In practice the only problems are unescaped quotes in strings, or mismatched quotes (start with `"` and terminate with `'`)
Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT
#174Earlier quoted context omitted.
Where does the inherent randomness come from?
It's injected into the model, you can deviate from no randomness to get "creative".
input += (Math.random - 0.5) * Coefficient * temperature
so setting temperature to 0 would mean no randomness. On thinking further about why there is inherent randomness I believe it is from a lack of associativity in floating point operations. They obviously do A LOT of parallel floating point operations.
Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT
#175Earlier quoted context omitted.
I like the typescript definition, rather than example json that I normally use.
Credit where it's due: I was working with structured data as JSON for the completion, and the Typescript definition hugely increased reliability. I took that from helpful advice (on Twitter) from Noah Brier who afiak came up with the approach: https://brxnd.substack.com/p/the-prompt-to-rule-all-prompts-...
Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT
#176Earlier quoted context omitted.
The prompt is probably simple, but the bigger challenge is that even a minified html of a typical web page would be more than the 4k gpt token limit
I extract the main content div, which includes various other divs and assorted HTML cruft from 25 years of content management systems. Then convert that to Markdown, which GPT groks happily, and it preserves the right balance of discarding meaningless structure but preserving some semantics (italics, headings, etc). The best tool I've found for that process is aaronsw's html2text, amazing that it's still so valuable…