Giter VIP home page Giter VIP logo

plaintextwikipedia's Introduction

PlainTextWikipedia

Convert Wikipedia database dumps into plain text files (JSON). This can parse literally all of Wikipedia with pretty high fidelity. There's a copy available on Kaggle Datasets

QUICK START

  1. Download and unzip a Wikipedia dump (see Data Sources below) make sure you get a monolithic XML file
  2. Open up wiki_to_text.py and edit the filename to point at your XML file. Also update the savedir location
  3. Run wiki_to_text.py

Data Sources

There are two primary data sources you'll want to use. See the table below for the root url.

Name Description Link
Simplified English Wikipedia This is only about 1GB and therefore is a great test set https://dumps.wikimedia.org/simplewiki/
English Wikipedia This is all of Wikipedia, so about 80GB unpacked https://dumps.wikimedia.org/enwiki/

Navigate into the latest dump. You're likley looking for the very first file in the download section. They will look something like this:

  • enwiki-20210401-pages-articles-multistream.xml.bz2 18.1 GB
  • simplewiki-20210401-pages-articles-multistream.xml.bz2 203.5 MB

Download and extract these to a storage directory. I usually shorten the folder name and filename.

Legal

https://en.wikipedia.org/wiki/Wikipedia:Reusing_Wikipedia_content

Wikipedia is published under Creative Commons Attribution Share-Alike license (CC-BY-SA).

My script is published under the MIT license but this does not confer the same privileges to the material you convert with it.

plaintextwikipedia's People

Contributors

daveshap avatar mamei16 avatar j-m0 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.