Datasets:

Modalities:
Image
Text
Formats:
arrow
Libraries:
Datasets
License:
Rohambarack commited on
Commit
5c60ef4
·
1 Parent(s): c1241f6

Add Docs 1

Browse files
README.md CHANGED
@@ -1,3 +1,97 @@
1
  ---
2
  license: cc0-1.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc0-1.0
3
  ---
4
+
5
+ # KB-Books
6
+
7
+
8
+ ## Dataset Description
9
+
10
+
11
+ ### Dataset Summary
12
+
13
+ Documents from the [Royal Danish Library](https://www.kb.dk/en) published between 1750 and 1930.
14
+
15
+ The dataset has each page of each document in image and text format. The text was extracted with [OCR](https://en.wikipedia.org/wiki/Optical_character_recognition) at the time of digitization.
16
+
17
+ The documents (books of various genres) were obtained from the library in .pdf format with additional metadata as .json files. The dataset was assembled to make these public domain Danish texts more accessible.
18
+
19
+ ### Languages
20
+
21
+ All texts are in Danish.
22
+
23
+ ## Dataset Structure
24
+
25
+ ### Data Instances
26
+
27
+ ```
28
+ {
29
+ "doc_id": "unique document identifier",
30
+ "page_id": "unique page identifier",
31
+ "page_image":"image of the page, extracted from a pdf",
32
+ "page_text": "OCRed text of the page, extracted from a pdf",
33
+ "author" : "name of the author. If more than one, separated by ';' ",
34
+ "title" : "document title",
35
+ "published" : "year of publishing",
36
+ "digitalized" : "year of processing the physical document by the library",
37
+ "file_name" : "file_name of the original PDF"
38
+ }
39
+ ```
40
+
41
+ The "page_text" was obtained through OCR, and is therefore likely to contain noisy data, especially in older documents, where the original text is either handwritten or printed in exaggerated fonts.
42
+
43
+ "author" and "title" may be missing, especially in documents published before 1833.
44
+
45
+ "digitalized" may be missing.
46
+
47
+
48
+ ### Data Splits
49
+
50
+ All data is in the "train" split.
51
+ Data in [./data](./data/) is organized by year of publication, and is segmented into ~5GB chunks.
52
+
53
+
54
+ ## Dataset Creation
55
+
56
+ ### Curation Rationale
57
+ The dataset makes public domain text data more accessible to whomever may wish to view it or use it.
58
+
59
+ The dataset was created to be used mainly for research purposes and Natural Language Processing tasks.
60
+
61
+ The documents were filtered to make sure no non-public domain data is added. See [pd_check.md](./pd_check/pd_check.md) for the confirming of public domain status and [scraping.md](./scrape/scraping.md) for collecting possible Danish authors.
62
+
63
+ **IMPORTANT: In case non-public domain data is found in the dataset, please let us know**
64
+
65
+ ### Source Data
66
+
67
+ Data consists of OCRed documents from the [Royal Danish Library](https://www.kb.dk/en) published between 1750 and 1930.
68
+ These documents are mostly books of various genres. No distinction was made among the documents based on genre. Additional to the text, the original PDF pages are also added as images for potentially improving the quality of text.
69
+
70
+ The source data was made by humans, chiefly danish speaking authors, poets and playwrights.
71
+
72
+ ### Data Extraction
73
+
74
+ #### Logic
75
+
76
+ The flowchart is for a broad understanding and is not a fully accurate representation.
77
+
78
+ ![Logic flowchart](./imgs/extract_flowchart.jpg)
79
+
80
+ The whole python script is provided for reference as [extract_data.py](./extract_data.py)
81
+
82
+ Made with:
83
+
84
+ - python 3.12.10
85
+
86
+ Required libraries for running:
87
+
88
+ - [PyMuPDF](https://pypi.org/project/PyMuPDF/) 1.26.0
89
+ - [datasets](https://pypi.org/project/datasets/) 3.5.0
90
+
91
+
92
+ ## Additional Information
93
+
94
+ ### Dataset Curators
95
+ ***write something here***
96
+ ### License
97
+ The documents in the dataset are part of the [public domain](https://creativecommons.org/public-domain/)
imgs/extract_flowchart.jpg ADDED

Git LFS Details

  • SHA256: 57a517940c63b16a91bd2462be2e2bdc4da316e7c08ee55914513a1d9a991119
  • Pointer size: 131 Bytes
  • Size of remote file: 120 kB
pd_check/imgs/pd_check_flowchart.jpg ADDED

Git LFS Details

  • SHA256: 300450337d26f1d26d0fcbce6b0a010fb4a7a5c7af8f29706cfab100e33e0d77
  • Pointer size: 131 Bytes
  • Size of remote file: 119 kB
pd_check/pd_check.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Public Domain Check - Confirming the author has died at least 70 years ago
2
+
3
+ ## Summary
4
+
5
+ The goal of the check is to avoid uploading non-public domain data.
6
+ The digitized documents obtained from the [Danish Royal Library](https://www.kb.dk/en) have a range of publishing dates from 1750 to 1930.
7
+
8
+ According to [Danish law](https://www.retsinformation.dk/eli/lta/2023/1093) 70 years must pass after the death of the author(s) in order for these documents to become part of the [public domain](https://creativecommons.org/public-domain/).
9
+
10
+ Based on this, the data can be separated to 3 distinct groups:
11
+ - **Published before 1833**: Even if the longest living human in modern history wrote that as soon as they were born, they still died more than 70 years ago
12
+ - **Copyright info supplied**: The Danish Royal Library provides meta data on several of these documents, in which they claim the writing is indeed part of the public domain
13
+ - **The rest**: Documents where public domain status has to be investigated
14
+
15
+ To confirm whether a document is part of the public domain or not, the author(s) indicated in the meta data were matched against a database of potential Danish authors. Both their full names and potential abbreviations were used. A document was marked as being in the public domain if:
16
+ - All authors were matched to at least one name in the reference database
17
+ - All of these matches had complete biographic information in the reference database
18
+ - The author(s) died at least 70 years ago
19
+ - The author(s) have been born at least 18 years before the publication date
20
+
21
+ It must be noted, that the digitization took place over the course of several years, the provided meta data mostly follows a standard layout, but some documents might differ in that regard. This can be a potential source of errors.
22
+
23
+ **IMPORTANT: In case some non-public domain document is found in the dataset, please let us know**
24
+
25
+
26
+ The matched authors and written media is available for reference in .parquet format as [public_domain_data.parquet](./public_domain_data.parquet)
27
+ The list of only the filenames of the selected works (used in the extraction process, and is probably less important to outside parties) is available as [public_domain_files.txt](./public_domain_files.txt)
28
+
29
+ ## Sources
30
+
31
+ Potential authors were gathered using [Web Scraping](../scrape/scraping.md)
32
+
33
+ ## Logic
34
+
35
+ The flowchart is for a broad understanding and is not a fully accurate representation.
36
+
37
+ ![Logic flowchart](./imgs/pd_check_flowchart.jpg)
38
+
39
+ The whole python script is provided for reference as [select_pd.py](./select_pd.py)
40
+
41
+ Made with:
42
+
43
+ - python 3.12.10
44
+
45
+ Required libraries for running:
46
+
47
+ - [PyMuPDF](https://pypi.org/project/PyMuPDF/) 1.26.0
48
+ - [datasets](https://pypi.org/project/datasets/) 3.5.0
scrape/imgs/scrape_flowchart.jpg ADDED

Git LFS Details

  • SHA256: 5ebd1d37b1a5db179344eb7f6bb3d7746f2a04ff2e6768f03b74a03b032d22f8
  • Pointer size: 130 Bytes
  • Size of remote file: 74.9 kB
scrape/scraping.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Data Scraping - potential Danish authors
2
+
3
+ ## Summary
4
+
5
+ The goal of the data collection was to identify people, mainly authors of written media (writers, poets, dramatists, essayists etc.), who could have created one or more of the digitized documents obtained from the [Danish Royal Library](https://www.kb.dk/en).
6
+
7
+ Multiple sites with famous danish personalities were scraped for potential authors.
8
+ Data obtained includes:
9
+ - Name
10
+ - Year of birth (if found)
11
+ - Year of death (if found)
12
+ - Link to the site with the data
13
+
14
+ It must be noted, that because not all the scraped sites follow the same standard layout, sometimes the relevant data was not fully extracted.
15
+
16
+ The recovered data is available for reference in .parquet format as [da_people_large.parquet](./da_people_large.parquet)
17
+
18
+ ## Sources
19
+
20
+ - [Wikipedia - (Danish speaking authors)](https://da.wikipedia.org/wiki/Kategori:Dansksprogede_forfattere)
21
+
22
+ - [Wikipedia - (People in the Danish Biographical Dictionary)](https://da.wikipedia.org/wiki/Kategori:Personer_i_Dansk_Biografisk_Leksikon)
23
+
24
+ - [Wikimedia Commons - (Writers from Denmark by name)](https://commons.wikimedia.org/w/index.php?title=Category:Writers_from_Denmark_by_name)
25
+
26
+ ## Logic
27
+
28
+ The flowchart is for a broad understanding and is not a fully accurate representation.
29
+
30
+ ![Logic flowchart](./imgs/scrape_flowchart.jpg)
31
+
32
+ The whole python script is provided for reference as [scrape_large.py](./scrape_large.py)
33
+
34
+ Made with:
35
+
36
+ - python 3.12.10
37
+
38
+ Required libraries for running:
39
+
40
+ - [bs4](https://pypi.org/project/beautifulsoup4/) 4.13.4
41
+ - [datasets](https://pypi.org/project/datasets/) 3.5.0