Skip to main content

Extract corpora from Wikipedia dumps

Project description

Wiki-Dump Reader

Travis Coverage

Extract corpora from wiki-dump.

Install

pip install wiki-dump-reader

Usage

The dump file *wiki-*-pages-articles.xml should be downloaded first. Then you can iterate and get cleaned text from the text:

from wiki_dump_reader import Cleaner, iterate

cleaner = Cleaner()
for title, text in iterate('*wiki-*-pages-articles.xml'):
    text = cleaner.clean_text(text)
    cleaned_text, links = cleaner.build_links(text)

Just ignore links if you don't need them:

cleaned_text, _ = cleaner.build_links(text)

See examples for an intuitive feeling.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wiki-dump-reader-0.0.4.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file wiki-dump-reader-0.0.4.tar.gz.

File metadata

  • Download URL: wiki-dump-reader-0.0.4.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

File hashes

Hashes for wiki-dump-reader-0.0.4.tar.gz
Algorithm Hash digest
SHA256 86532997c6870b46182eed6c461049dfebaea37d6f59f90d7ff5bcd4d85db04d
MD5 1ee0b84ddb642e703579a1754e69599c
BLAKE2b-256 ab79e70b9c27a3038bad28448e8183ee59a248d968aeb942dff94d61dcf10c45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page