Datasets:
identifier string | collection string | open_type string | license string | date float64 | title string | creator string | language string | language_type string | word_count int64 | token_count int64 | text string | __index_level_0__ int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
MMKB10:000599001:mpeg21_18 | Dutch-PD | Open Culture | Public Domain | 1,849 | Militaire spectator; tijdschrift voor het Nederlandsche leger, 1849, 01-01-1849 | null | Dutch | Spoken | 7,053 | 12,360 | Toen deze deugd hen niet meer versierde, waren zij die geduchte strijders niet meer, en zoo zien wij langzamerhand dat het eerste volk der oudheid, door weelde en overvloed ontzenuw d, voor wilde en woeste horden moest onderdoen. Krijgskundige wetenschap mogt de operatiën hunner legers besturen, de kracht ontbrak om he... | 37,419 |
MMUBA08:000001452_15 | Dutch-PD | Open Culture | Public Domain | 1,843 | Encyclopedisch woordenboek der praktische geneesmiddelleer, naar de beste bronnen en eigene veeljarige ondervinding bewerkt | Most, G.F. | Dutch | Spoken | 7,590 | 16,650 | In de angina maligna gangraenosa, bij variolae putridae, in febris nervosa versatilis, in rheumatismus fixus non febrile en rheumatismus vagus, bij verouderde catarrhale borstaandoeningen inef, torpor, bij priapismus, satyriasis en nympliomanie, bij epilepsie van jonge, zeer prikkelbare, bleeke, spastische meisjes ten ... | 35,052 |
MMUBA08:000001308_48 | Dutch-PD | Open Culture | Public Domain | 1,846 | Handboek der geneesmiddelleer | Oesterlen, F. | Dutch | Spoken | 7,026 | 13,726 | Het zou vergeefsche moeite zijn, de gevallen waarin braakwijnsteen bij bovengenoemde aandoeningen behoort gegeven te worden nog meer in het bijzonder te willen aangeven , daar het ons ook hier aan vaste grondslagen ontbreekt. Wij laten dus hier alleen het een en ander, tot meerdere volledigheid, volgen. Bij pneumonie w... | 48,555 |
MMTEY01:179546002:mpeg21_13 | Dutch-PD | Open Culture | Public Domain | 1,872 | Archives néerlandaises des sciences exactes et naturelles | E. GERLAND. | French | Spoken | 11,464 | 18,910 | "Ailleurs, toutefois, on voit aussi des agrégats en forme de houppes radiées, et en outre des nodu(...TRUNCATED) | 22,411 |
MMZB04:180384002:mpeg21_1 | Dutch-PD | Open Culture | Public Domain | 1,884 | "Almanak voor het jaar ... : jaarboekje uitgegeven door de Maatschappij ter Bevordering van den Land(...TRUNCATED) | null | Dutch | Spoken | 11,599 | 23,223 | ")atum| Januari. Ontvangst.! Uitgaaf. T — I !! F ï ' 66 langer hoe meer ontwikkeld worden; verkee(...TRUNCATED) | 9,701 |
MMUBVU04:001829050:mpeg21_1 | Dutch-PD | Open Culture | Public Domain | 1,852 | Heraut; eene stem over Israe\u0308l en tot Israe\u0308l, jrg 3, 1852, no. 50, 11-12-1852 | null | Dutch | Spoken | 4,218 | 7,312 | "1852. Derde Jaargang. No. 50. BE HERAUT. EENE STEM OVER ISRAËL EN\" TOT ISRAËL. Jes. Lil: 7. Tprm(...TRUNCATED) | 13,079 |
MMSFUBU02:000050085_1 | Dutch-PD | Open Culture | Public Domain | 1,873 | Stellingen ter verkrijging van den graad van doctor in het Romeinsch en hedendaagsch recht ... | Prins, Charles Hubert | Dutch | Spoken | 805 | 1,540 | "STELLINGEN, TER VERKRIJGING VA» PEN GRAAD VAN Doctor in (jet tatinscfj eu §ebenbaagscl| lecff, AA(...TRUNCATED) | 9,671 |
MMKB10:000615002:mpeg21_38 | Dutch-PD | Open Culture | Public Domain | 1,863 | Militaire spectator; tijdschrift voor het Nederlandsche leger, 1863, 01-02-1863 | null | Dutch | Spoken | 6,917 | 12,327 | "Eindelijk moet men nog zorgen voor genoegzame gemeenschap langs de omheining, tussen de voorliggend(...TRUNCATED) | 14,455 |
MMTSGG01:012261000_1 | Dutch-PD | Open Culture | Public Domain | 1,800 | Het kruis van Christus de roem des Christens | null | Dutch | Spoken | 5,679 | 8,967 | "HET KRUIS TAN CHRISTUS DE ROEM DES CHRISTENS. LEERREDE OVER GAL. VI. 14. GEZONGEN: Gez. 118. 9, 20,(...TRUNCATED) | 39,726 |
MMKB13:002612006:mpeg21_1 | Dutch-PD | Open Culture | Public Domain | 1,801 | Algemeene konst- en letter-bode, voor het jaar ..., 1801, no. 6, 06-02-1801 | null | Dutch | Spoken | 4,996 | 9,989 | "algemene K O N S T■ Ê N LETTER -BODE, VOOR HET JAAR 1801. N°. 6. Vrydag den 6 Februari BERIG T (...TRUNCATED) | 7,783 |
Common Corpus v2 - Dutch Public Domain collection
This is a version of Common Corpus v2 filtered to keep only the rows where collection is "Dutch-PD".
Looking for all Dutch-language documents in Common Corpus, regardless of the collection they are in?
Then you might want to look at Rijgersberg/common_corpus_nl.
Common Corpus is a very large open and permissible licensed text dataset created by Pleias. Please be sure to acknowledge the creators of the original dataset when using this filtered version.
Filtering
Common Corpus is a collection of disparate datasets.
There is no easy way to select subsets or languages of Common Corpus,
so this dataset has extracted the Dutch-PD subset to be used separately.
Usage
from datasets import load_dataset
dataset = load_dataset('Rijgersberg/common_corpus_dutch_pd', split='train')
Contents
The dataset has the following content.
Tokens are measured by the robbert-2023-dutch-base Dutch tokenizer on the text column only.
word_count is taken directly from the word_count column of the dataset.
| collection | open_type | row_count | word_count | token_count |
|---|---|---|---|---|
| Dutch-PD | Open Culture | 219,209 | 1,461,934,337 | 2,798,438,458 |
Code
In principle it is very easy to create the dataset by filtering Common Corpus using Hugging Face datasets' dataset.filter() functionality.
However, Common Corpus is larger than my available disk space.
A possible solution is to process Common Corpus streaming and relying on the fact that the Dutch subset will be much, much smaller than the full dataset. The code for that solution is below. However, I was having trouble streaming the entire dataset without any connection errors along the way.
from datasets import load_dataset, Dataset
common_corpus = load_dataset('PleIAs/common_corpus', split='train', streaming=True)
def nl():
for row in common_corpus:
if row['collection'] == 'Dutch-PD':
yield row
common_corpus_nl = Dataset.from_generator(nl)
common_corpus_nl.push_to_hub('Rijgersberg/common_corpus_nl')
Therefore I took the approach for every one of ten subfolders of Common Corpus:
- downloading the subfolder in a fault-tolerant way
- doing the filtering to Dutch-PD rows only
- uploading that by itself to the Hugging Face hub
- deleting all the downloaded files and datasets cache files (around 1.5 TB for every subfolder)
Then finally I concatenated the ten Dutch-PD datasets into a single one, which is the one you are looking at.
import shutil
from datasets import concatenate_datasets, load_dataset
from huggingface_hub import snapshot_download
from huggingface_hub.errors import LocalEntryNotFoundError
from requests import ReadTimeout
local_dir = "/path/to/downloadfolder/commoncorpus"
for i in range(1, 10+1):
success = False
while not success:
try:
# download one common corpus folder at a time to a local directory
snapshot_download( # will skip files that have already been downloaded
repo_id='PleIAs/common_corpus',
repo_type='dataset',
allow_patterns=f'common_corpus_{i}/*',
local_dir=local_dir
)
success = True
except (LocalEntryNotFoundError, ReadTimeout) as e:
print(e)
subdataset = load_dataset(local_dir, split='train')
dutchpd = subdataset.filter(lambda collection: collection == 'Dutch-PD', input_columns=['collection'])
dutchpd.push_to_hub(f'Rijgersberg/common_corpus_dutch_pd_{i}')
# remove local copies of the data to free up disk space
shutil.rmtree(local_dir)
shutil.rmtree('/path/to/cache/huggingface/datasets/commoncorpus')
# concatenate all (much smaller) Dutch-PD datasets into a single dataset
common_corpus_nl = concatenate_datasets([load_dataset(f'Rijgersberg/common_corpus_dutch_pd_{i}', split='train')
for i in range(1, 10+1)])
common_corpus_nl.push_to_hub('Rijgersberg/common_corpus_dutch_pd')
- Downloads last month
- 69