Live data from Hacker News

Ask HN: Has anyone had luck using the Wikipedia data dumps?

news.ycombinator.com

1–10 of 14 posts

Re: Ask HN: Has anyone had luck using the Wikipedia data dumps?

#2
This may not be the most helpful reply but I remember having to use some "importing tool". Wikipedia provides you with standard SQL dumps yet simply importing them into the DB is not going to cut it. The community has created import scripts which simplify the process to a degree.

Re: Ask HN: Has anyone had luck using the Wikipedia data dumps?

#4
I also didn't find much information about how long it would take to import into a db, so I used the xml dumps directly [1]. I only needed the wiki content (not the history), so the article xml files worked well for me. And then I used mwparserfromhell [2] to parse and extract from the wiki markup.

[1] https://dumps.wikimedia.org/enwiki/20190301/

[2] https://mwparserfromhell.readthedocs.io/en/latest/

Re: Ask HN: Has anyone had luck using the Wikipedia data dumps?

#6

I also didn't find much information about how long it would take to import into a db, so I used the xml dumps directly [1]. I only needed the wiki content (not the history), so the article xml files worked well for me. And then I used mwparserfromhell [2] to parse and extract from the wiki markup. [1] https://dumps.wikimedia.org/enwiki/20190301/ [2] https://mwparserfromhell.readthedocs.io/en/latest/

I've been working on some research for a recommender system using xml wiki article dumps the last few months. I've been using mwparserfromhell as well to get plain text and some other metadata I needed from articles to create a dataset. It seems to work pretty well for that use case anyway.

Re: Ask HN: Has anyone had luck using the Wikipedia data dumps?

#7
I have toyed around with the Wikipedia dump -- in XML, downloaded through the provided torrent file on Wikipedia.

It took a bit to get accustomed to the format, but after looking at the files and doing a bit of research on the documentation, using Python with lxml made it relatively straightforward to do what I was interested in.

I'd recommend doing the same, only because it worked for me: get the XML dump, manually check out some files to understand what is going on, search for documentation on the file format and maybe read a few blog posts, and then convert the XML files to data structures suited for what you're interested in.

Re: Ask HN: Has anyone had luck using the Wikipedia data dumps?

#8
I wrote a simple parser in node to import the article dump into an Elasticsearch instance as a part of a hands on tutorial: https://github.com/kldavis4/kuali-days-2017-elasticsearch/bl.... At the time, on the full dump, it took quite a while to ingest (days as I recall).

Re: Ask HN: Has anyone had luck using the Wikipedia data dumps?

#9
While building the Wikipedia mirror on IPFS (with search), we tried using the dumps from Wikipedia themselves but ended up using Zim archives from kiwix.org instead. The end result is here: https://github.com/ipfs/distributed-wikipedia-mirror

For actually ingesting the archives, dignifiedquire expanded a Rust utility aptly named Zim, which you can find here https://github.com/dignifiedquire/zim

Both repos contain information (and code of course) on how to extract information from the Zim archives

Re: Ask HN: Has anyone had luck using the Wikipedia data dumps?

#10
I've had some success using this tutorial: https://www.kdnuggets.com/2017/11/building-wikipedia-text-co... .

And I've changed it a little bit to extract only the first n characters, this might be of some use since wikipedia dump are supposed to be pretty large: https://github.com/mooss/ruskea/blob/master/make_wiki_corpus... .

Post reply on HN