Giter Site home page Giter Site logo

ryfan-rs / wikipedia-summary-dataset Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tscheepers/wikipedia-summary-dataset

0.0 1.0 0.0 49 KB

This dataset contains all titles and summaries (or introductions) of English Wikipedia articles, extracted in september of 2017. It could be useful if one wants to use the smaller, more concise, and more definitional summaries in their research. Or if one just wants to use a smaller but still diverse dataset for efficient training with resource constraints.

Home Page: http://thijs.ai/Wikipedia-Summary-Dataset/

Python 100.00%

wikipedia-summary-dataset's Introduction

Wikipedia Summary Dataset

This is a dataset that can be used for research into machine learning and natural language processing. It contains all titles and summaries (or introductions) of English Wikipedia articles, extracted in September of 2017.

The dataset is different from the regular Wikipedia dump and different from the datasets that can be created by gensim because ours contains the extracted summaries and not the entire unprocessed page body. This could be useful if one wants to use the smaller, more concise, and more definitional summaries in their research. Or if one just wants to use a smaller but still diverse dataset for efficient training with resource constraints.

A summary or introduction of an article is everything starting from the page title up to the content outline.

Wikipedia Summary Example

The raw dataset leaves the original text structure intact. Additionally, we provide pre-processed versions.

File Tokenized Lowercased No Punctuation No stop words Stemmed
raw.tar.gz
tokenized.tar.gz
lowercased.tar.gz
without-punctuation.tar.gz
without-stop-words.tar.gz
stemmed.tar.gz

Download

Dataset contents

The tarbals contain two files. A .txt file and a .vocab file. The .txt file contains all the necessary data. Each line represents an article and contains both a title and a summary separated by |||. The lines are ordered by Wikipedia page_id. If you want to create a smaller test dataset, I would suggest sampling lines from the file and not splitting it directly.

Example from tokenized.txt:

Anarchism ||| Anarchism is a political philosophy that advocates self-governed societies based on voluntary…
Autism ||| Autism is a neurodevelopmental disorder characterized by impaired social interaction , impaired verbal…
Albedo ||| Albedo ( ) is a measure for reflectance or optical brightness ( Latin albedo , `` whiteness '' ) of…
…

There is also a .vocab file which contains the vocabulary and the count of each token. Example from tokenized.vocab:

, 27222735
the 25505452
. 21555700
of 16267241
in 13313133
and 12630336
a 10202887
is 7770405
…

Dataset construction

The dataset was constructed using a script that calls Wikipedia API for every page with their page_id. The correct way to construct summaries without any unwanted artifacts is constructing them by using the TextExtracts extension. So the API call we used, also uses the TextExtracts extension to create the summaries or introductions. As you can imagine, this takes quite a while.

https://en.wikipedia.org/w/api.php?format=json&maxlag=5&action=query&prop=extracts&exintro=&explaintext=&pageids=123|456|789

The actual downloading is done using download.py and stores the raw JSON output of the API in a separate folder. Afterwards the script process.py can combine all these API responses into two big files, i.e. a .txt file and a .vocab file.

Scripts to create the dataset are provided in this repository. They require a local Wikipedia installation and access to its MySQL database filled with data to get the page identifiers (page_id). You can fill a MySQL database with the Wikipedia data from the dump using MWDumper.

Additionally, we would ask you not to build the dataset using the official Wikipedia API if this is not needed, since building the dataset would require calling the API for every page and this puts strain on their public API. Please respect the maxlag=5 parameter if you use the official API en.wikipedia.org/w/api.php.

wikipedia-summary-dataset's People

Contributors

tscheepers avatar

Watchers

 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.