Live data from Hacker News

Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT

genmon.github.io

171–177 of 177 posts

Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT

#171

> 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?

Shared in this comment

https://news.ycombinator.com/item?id=35073824

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

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 after all these years.

Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT

#173

I 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?

The general rule is: be minimally liberal in what I receive :)

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

#174

Earlier 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".

Isn't the temperature the "injected" randomness? The way I imagine it would be somewhere in the model you would do

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

#175
post #37
post #23

Earlier 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-...

One interesting side effect of the Typescript interface approach is that it doesn't tokenize well: https://twitter.com/m1guelpf/status/1630015536632569857

Re: Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT

#176
post #172

Earlier 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…

Thanks for explaining — very helpful!
Post reply on HN