Live data from Hacker News

Experimental library for scraping websites using OpenAI's GPT API

jamesturk.github.io

81–90 of 149 posts

Re: Experimental library for scraping websites using OpenAI's GPT API

#81
post #41

This may finally be a solution for scraping wikipedia and turning it into structured data. (Or do we even need structured data in the post-AI age?) Mediawiki is notorious for being hard to parse: * https://github.com/spencermountain/wtf_wikipedia#ok-first- - why it's hard * https://techblog.wikimedia.org/2022/04/26/what-it-takes-to-p... - an entire article about parsing page TITLES * https://osr.cs.fau.de/wp-content/…

You might find this meets many needs: https://query.wikidata.org/querybuilder/ edit: I tried asking ChatGPT to write SPARQL queries, but the Q123 notation used by Wikidata seems to confuse it. I asked for winners of the Man Booker Prize and it gave me code that was used the Q id for the band Slayer instead of the Booker Prize.

its wikidata, not wikipedia, they are two disjoint datasets.

Re: Experimental library for scraping websites using OpenAI's GPT API

#82

Earlier quoted context omitted.

You might find this meets many needs: https://query.wikidata.org/querybuilder/ edit: I tried asking ChatGPT to write SPARQL queries, but the Q123 notation used by Wikidata seems to confuse it. I asked for winners of the Man Booker Prize and it gave me code that was used the Q id for the band Slayer instead of the Booker Prize.

its wikidata, not wikipedia, they are two disjoint datasets.

Basically every wikipedia page (across languages) is linked to wikidata, and some infoboxes are generated directly from wikidata, so they're seperate, but overlapping and increasingly so.

https://en.wikipedia.org/wiki/Category:Articles_with_infobox...

edit: slightly wider scope category pointing to pages using wikidata in different ways:

https://en.wikipedia.org/wiki/Category:Wikipedia_categories_...

Re: Experimental library for scraping websites using OpenAI's GPT API

#83

I follow some indie hackers online who are in the scraping space, such as BrowserBear and Scrapingbee, I wonder how they will fare with something like this. The only solace is that this is nondeterministic, but perhaps you can simply ask the API to create Python or JS code that is deterministic, instead. More generally, I wonder how a lot of smaller startups will fare once OpenAI subsumes their product. Those who are…

Scraping using LLMs directly is going to be really quite slow and resource intensive, but obviously quicker to get setup and going. I can see it being useful for quick ad-hock scrapes, but as soon as you need to scrape 10s or 100s thousands of pages it will certainly be better to go the traditional route. Using LLM to write your scrapers though is a perfect use case for them. To put it somewhat in context, the two ty…

> Using LLM to write your scrapers though is a perfect use case for them.

Indeed... and they could periodically do an expensive LLM-powered scrape like this one and compare the results. That way they could figure out by themselves if any updates to the traditional scraper they've written are required.

Re: Experimental library for scraping websites using OpenAI's GPT API

#84
post #41

This may finally be a solution for scraping wikipedia and turning it into structured data. (Or do we even need structured data in the post-AI age?) Mediawiki is notorious for being hard to parse: * https://github.com/spencermountain/wtf_wikipedia#ok-first- - why it's hard * https://techblog.wikimedia.org/2022/04/26/what-it-takes-to-p... - an entire article about parsing page TITLES * https://osr.cs.fau.de/wp-content/…

> do we even need structured data in the post-AI age?

Even humans benefit quite a bit from structured data, I don't see why AIs would be any different, even if the AIs take over some of the generation of structured data.

Re: Experimental library for scraping websites using OpenAI's GPT API

#85

Earlier quoted context omitted.

its wikidata, not wikipedia, they are two disjoint datasets.

Basically every wikipedia page (across languages) is linked to wikidata, and some infoboxes are generated directly from wikidata, so they're seperate, but overlapping and increasingly so. https://en.wikipedia.org/wiki/Category:Articles_with_infobox... edit: slightly wider scope category pointing to pages using wikidata in different ways: https://en.wikipedia.org/wiki/Category:Wikipedia_categories_...

I agree there is strong overlap between entities, and also infobox values, but both wikidata and wikipedia has many more disjoint datapoints: many tables, factual statements in wikipedia which are not in wikidata, and many statements in wikidata which are not in wikipedia.

Re: Experimental library for scraping websites using OpenAI's GPT API

#86
post #59

Earlier quoted context omitted.

Counterexample: https://mobile.twitter.com/random_walker/status/163692305837...

Is he using that same library though? Otherwise I wouldn’t call it a counterexample.

Well later in the thread he corrects to say it was GPT 3.5 turbo, so not that relevant anyway. https://mobile.twitter.com/random_walker/status/163694532497...

Re: Experimental library for scraping websites using OpenAI's GPT API

#87
post #43

Earlier quoted context omitted.

Setting temperature to 0 does not make it completely deterministic, from their documentation: > OpenAI models are non-deterministic, meaning that identical inputs can yield different outputs. Setting temperature to 0 will make the outputs mostly deterministic, but a small amount of variability may remain.

My understanding of LLMs is sub-par at best, could someone explain where the randomness comes from in the event that the model temperature is 0? I guess I was imagining that if temperature was 0, and the model was not being continuously trained, the weights wouldn’t change, and the output would be deterministic. Is this a feature of LLMs more generally or has OpenAI more specifically introduced some other degree of r…

It's not the LLM, but the hardware. GPU operations generally involve concurrency that makes them non-deterministic, unless you give up some speed to make them deterministic.

Re: Experimental library for scraping websites using OpenAI's GPT API

#88
post #41

This may finally be a solution for scraping wikipedia and turning it into structured data. (Or do we even need structured data in the post-AI age?) Mediawiki is notorious for being hard to parse: * https://github.com/spencermountain/wtf_wikipedia#ok-first- - why it's hard * https://techblog.wikimedia.org/2022/04/26/what-it-takes-to-p... - an entire article about parsing page TITLES * https://osr.cs.fau.de/wp-content/…

You might find this meets many needs: https://query.wikidata.org/querybuilder/ edit: I tried asking ChatGPT to write SPARQL queries, but the Q123 notation used by Wikidata seems to confuse it. I asked for winners of the Man Booker Prize and it gave me code that was used the Q id for the band Slayer instead of the Booker Prize.

To be fair, I was quite confused by wikidata query notation when I tried it as well.

Re: Experimental library for scraping websites using OpenAI's GPT API

#90

Earlier quoted context omitted.

My understanding of LLMs is sub-par at best, could someone explain where the randomness comes from in the event that the model temperature is 0? I guess I was imagining that if temperature was 0, and the model was not being continuously trained, the weights wouldn’t change, and the output would be deterministic. Is this a feature of LLMs more generally or has OpenAI more specifically introduced some other degree of r…

It's not the LLM, but the hardware. GPU operations generally involve concurrency that makes them non-deterministic, unless you give up some speed to make them deterministic.

Specifically, as I ubderstand it, the accumulation of rounding errors differs with the order in which floating point values are completed and intermediate aggregates are calculated, unless you put wait conditions in so that the aggregation order is fixed even if the completion order varies, which reduces efficient use of available compute cores in exchange for determinism.
Post reply on HN