Datasets:
Commit
•
9c564ba
0
Parent(s):
Update files from the datasets library (from 1.17.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.17.0
- .gitattributes +27 -0
- README.md +402 -0
- blbooksgenre.py +340 -0
- dataset_infos.json +1 -0
- dummy/annotated_raw/1.1.0/dummy_data.zip +3 -0
- dummy/raw/1.1.0/dummy_data.zip +3 -0
- dummy/title_genre_classifiction/1.1.0/dummy_data.zip +3 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,402 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- crowdsourced
|
6 |
+
- expert-generated
|
7 |
+
languages:
|
8 |
+
- en
|
9 |
+
- de
|
10 |
+
- fr
|
11 |
+
- nl
|
12 |
+
licenses:
|
13 |
+
- cc0-1-0
|
14 |
+
multilinguality:
|
15 |
+
- multilingual
|
16 |
+
pretty_name: British Library Books Genre
|
17 |
+
size_categories:
|
18 |
+
title_genre_classifiction:
|
19 |
+
- 1K<n<10K
|
20 |
+
annotated_raw:
|
21 |
+
- 1K<n<10K
|
22 |
+
raw:
|
23 |
+
- 10K<n<100K
|
24 |
+
source_datasets:
|
25 |
+
- original
|
26 |
+
task_categories:
|
27 |
+
- text-classification
|
28 |
+
- sequence-modeling
|
29 |
+
task_ids:
|
30 |
+
- topic-classification
|
31 |
+
- multi-label-classification
|
32 |
+
- language-modeling
|
33 |
+
---
|
34 |
+
|
35 |
+
# Dataset Card for blbooksgenre
|
36 |
+
|
37 |
+
## Table of Contents
|
38 |
+
|
39 |
+
- [Dataset Card for blbooksgenre](#dataset-card-for-blbooksgenre)
|
40 |
+
- [Table of Contents](#table-of-contents)
|
41 |
+
- [Dataset Description](#dataset-description)
|
42 |
+
- [Dataset Summary](#dataset-summary)
|
43 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
44 |
+
- [Supervised tasks](#supervised-tasks)
|
45 |
+
- [Languages](#languages)
|
46 |
+
- [Dataset Structure](#dataset-structure)
|
47 |
+
- [Data Instances](#data-instances)
|
48 |
+
- [Data Fields](#data-fields)
|
49 |
+
- [Data Splits](#data-splits)
|
50 |
+
- [Dataset Creation](#dataset-creation)
|
51 |
+
- [Curation Rationale](#curation-rationale)
|
52 |
+
- [Source Data](#source-data)
|
53 |
+
- [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
|
54 |
+
- [Who are the source language producers?](#who-are-the-source-language-producers)
|
55 |
+
- [Annotations](#annotations)
|
56 |
+
- [Annotation process](#annotation-process)
|
57 |
+
- [Who are the annotators?](#who-are-the-annotators)
|
58 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
59 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
60 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
61 |
+
- [Discussion of Biases](#discussion-of-biases)
|
62 |
+
- [Colonialism](#colonialism)
|
63 |
+
- [Other Known Limitations](#other-known-limitations)
|
64 |
+
- [Additional Information](#additional-information)
|
65 |
+
- [Dataset Curators](#dataset-curators)
|
66 |
+
- [Licensing Information](#licensing-information)
|
67 |
+
- [Citation Information](#citation-information)
|
68 |
+
- [Contributions](#contributions)
|
69 |
+
|
70 |
+
## Dataset Description
|
71 |
+
|
72 |
+
- **Homepage:**: [https://doi.org/10.23636/BKHQ-0312](https://doi.org/10.23636/BKHQ-0312)
|
73 |
+
- **Repository:** [https://doi.org/10.23636/BKHQ-0312](https://doi.org/10.23636/BKHQ-0312)
|
74 |
+
- **Paper:**
|
75 |
+
- **Leaderboard:**
|
76 |
+
- **Point of Contact:**
|
77 |
+
|
78 |
+
### Dataset Summary
|
79 |
+
|
80 |
+
This dataset consists of metadata relating to books [digitised by the British Library in partnership with Microsoft](https://www.bl.uk/collection-guides/google-books-digitised-printed-heritage). Some of this metadata was exported from the British Library catalogue whilst others was generated as part of a crowdsourcing project. The text of this book and other metadata can be found on the [date.bl](https://data.bl.uk/bl_labs_datasets/#3) website.
|
81 |
+
|
82 |
+
The majority of the books in this collection were published in the 18th and 19th Century but the collection also includes a smaller number of books from earlier periods. Items within this collection cover a wide range of subject areas including geography, philosophy, history, poetry and literature and are published in a variety of languages.
|
83 |
+
|
84 |
+
For the subsection of the data which contains additional crowsourced annotations the date of publication breakdown is as follows:
|
85 |
+
|
86 |
+
| | Date of publication |
|
87 |
+
| ---- | ------------------- |
|
88 |
+
| 1630 | 8 |
|
89 |
+
| 1690 | 4 |
|
90 |
+
| 1760 | 10 |
|
91 |
+
| 1770 | 5 |
|
92 |
+
| 1780 | 5 |
|
93 |
+
| 1790 | 18 |
|
94 |
+
| 1800 | 45 |
|
95 |
+
| 1810 | 96 |
|
96 |
+
| 1820 | 152 |
|
97 |
+
| 1830 | 182 |
|
98 |
+
| 1840 | 259 |
|
99 |
+
| 1850 | 400 |
|
100 |
+
| 1860 | 377 |
|
101 |
+
| 1870 | 548 |
|
102 |
+
| 1880 | 776 |
|
103 |
+
| 1890 | 1484 |
|
104 |
+
| 1900 | 17 |
|
105 |
+
| 1910 | 1 |
|
106 |
+
| 1970 | 1 |
|
107 |
+
|
108 |
+
[More Information Needed]
|
109 |
+
|
110 |
+
|
111 |
+
### Supported Tasks and Leaderboards
|
112 |
+
|
113 |
+
The digitised books collection which this dataset describes has been used in a variety of digital history and humanities projects since being published.
|
114 |
+
|
115 |
+
This dataset is suitable for a variety of unsupervised tasks and for a 'genre classification task'.
|
116 |
+
|
117 |
+
#### Supervised tasks
|
118 |
+
|
119 |
+
The main possible use case for this dataset is to develop and evaluate 'genre classification' models. The dataset includes human generated labels for whether a book is 'fiction' or 'non-fiction'. This has been used to train models for genre classifcation which predict whether a book is 'fiction' or 'non-fiction' based on its title.
|
120 |
+
|
121 |
+
### Languages
|
122 |
+
|
123 |
+
[More Information Needed]
|
124 |
+
|
125 |
+
## Dataset Structure
|
126 |
+
|
127 |
+
The dataset currently has three configurations intended to support a range of tasks for which this dataset could be used for:
|
128 |
+
|
129 |
+
- `title_genre_classifiction` : this creates a de-duplicated version of the dataset with the `BL record`, `title` and `label`.
|
130 |
+
- `annotated_raw`: This version of the dataset includes all fields from the original dataset which are annotated. This includes duplication from different annotators"
|
131 |
+
- `raw`: This version of the dataset includes all the data from the original data including data without annotations.
|
132 |
+
|
133 |
+
### Data Instances
|
134 |
+
|
135 |
+
An example data instance from the `title_genre_classifiction` config:
|
136 |
+
|
137 |
+
```python
|
138 |
+
{'BL record ID': '014603046',
|
139 |
+
'title': 'The Canadian farmer. A missionary incident [Signed: W. J. H. Y, i.e. William J. H. Yates.]',
|
140 |
+
'label': 0}
|
141 |
+
```
|
142 |
+
|
143 |
+
An example data instance from the `annotated_raw` config:
|
144 |
+
|
145 |
+
```python
|
146 |
+
{'BL record ID': '014603046',
|
147 |
+
'Name': 'Yates, William Joseph H.',
|
148 |
+
'Dates associated with name': '',
|
149 |
+
'Type of name': 'person',
|
150 |
+
'Role': '',
|
151 |
+
'All names': ['Yates, William Joseph H. [person] ', ' Y, W. J. H. [person]'],
|
152 |
+
'Title': 'The Canadian farmer. A missionary incident [Signed: W. J. H. Y, i.e. William J. H. Yates.]',
|
153 |
+
'Variant titles': '',
|
154 |
+
'Series title': '',
|
155 |
+
'Number within series': '',
|
156 |
+
'Country of publication': ['England'],
|
157 |
+
'Place of publication': ['London'],
|
158 |
+
'Publisher': '',
|
159 |
+
'Date of publication': '1879',
|
160 |
+
'Edition': '',
|
161 |
+
'Physical description': 'pages not numbered, 21 cm',
|
162 |
+
'Dewey classification': '',
|
163 |
+
'BL shelfmark': 'Digital Store 11601.f.36. (1.)',
|
164 |
+
'Topics': '',
|
165 |
+
'Genre': '',
|
166 |
+
'Languages': ['English'],
|
167 |
+
'Notes': 'In verse',
|
168 |
+
'BL record ID for physical resource': '004079262',
|
169 |
+
'classification_id': '267476823.0',
|
170 |
+
'user_id': '15.0',
|
171 |
+
'subject_ids': '44369003.0',
|
172 |
+
'annotator_date_pub': '1879',
|
173 |
+
'annotator_normalised_date_pub': '1879',
|
174 |
+
'annotator_edition_statement': 'NONE',
|
175 |
+
'annotator_FAST_genre_terms': '655 7 ‡aPoetry‡2fast‡0(OCoLC)fst01423828',
|
176 |
+
'annotator_FAST_subject_terms': '60007 ‡aAlice,‡cGrand Duchess, consort of Ludwig IV, Grand Duke of Hesse-Darmstadt,‡d1843-1878‡2fast‡0(OCoLC)fst00093827',
|
177 |
+
'annotator_comments': '',
|
178 |
+
'annotator_main_language': '',
|
179 |
+
'annotator_other_languages_summaries': 'No',
|
180 |
+
'annotator_summaries_language': '',
|
181 |
+
'annotator_translation': 'No',
|
182 |
+
'annotator_original_language': '',
|
183 |
+
'annotator_publisher': 'NONE',
|
184 |
+
'annotator_place_pub': 'London',
|
185 |
+
'annotator_country': 'enk',
|
186 |
+
'annotator_title': 'The Canadian farmer. A missionary incident [Signed: W. J. H. Y, i.e. William J. H. Yates.]',
|
187 |
+
'Link to digitised book': 'http://access.bl.uk/item/viewer/ark:/81055/vdc_00000002842E',
|
188 |
+
'annotated': True,
|
189 |
+
'Type of resource': 0,
|
190 |
+
'created_at': datetime.datetime(2020, 8, 11, 14, 30, 33),
|
191 |
+
'annotator_genre': 0}
|
192 |
+
```
|
193 |
+
|
194 |
+
### Data Fields
|
195 |
+
|
196 |
+
The data fields differ slightly between configs. All possible fields for the `annotated_raw` config are listed below. For the `raw` version of the dataset datatypes are usually string to avoid errors when processing missing values.
|
197 |
+
|
198 |
+
- `BL record ID`: an internal ID used by the British Library, this can be useful for linking this data to other BL collections.
|
199 |
+
- `Name`: name associated with the item (usually author)
|
200 |
+
- `Dates associated with name`: dates associated with above e.g. DOB
|
201 |
+
- `Type of name`: whether `Name` is a person or an organization etc.
|
202 |
+
- `Role`: i.e. whether `Name` is `author`, `publisher` etc.
|
203 |
+
- `All names`: a fuller list of names associated with the item.
|
204 |
+
- `Title`: The title of the work
|
205 |
+
- `Variant titles`
|
206 |
+
- `Series title`
|
207 |
+
- `Number within series`
|
208 |
+
- `Country of publication`: encoded as a list of countries listed in the metadata
|
209 |
+
- `Place of publication`: encoded as a list of places listed in the metadata
|
210 |
+
- `Publisher`
|
211 |
+
- `Date of publication`: this is encoded as a string since this field can include data ranges i.e.`1850-1855`.
|
212 |
+
- `Edition`
|
213 |
+
- `Physical description`: encoded as a string since the format of this field varies
|
214 |
+
- `Dewey classification`
|
215 |
+
- `BL shelfmark`: a British Library shelf mark
|
216 |
+
- `Topics`: topics included in the catalogue record
|
217 |
+
- `Genre` the genre information included in the original catalogue record note that this is often missing
|
218 |
+
- Languages`; encoded as a list of languages
|
219 |
+
- `Notes`: notes from the catalogue record
|
220 |
+
- `BL record ID for physical resource`
|
221 |
+
|
222 |
+
The following fields are all generated via the crowdsourcing task (discussed in more detail below)
|
223 |
+
|
224 |
+
- `classification_id`: ID for the classification in the annotation task
|
225 |
+
- `user_id` ID for the annotator
|
226 |
+
- `subject_ids`: internal annotation task ID
|
227 |
+
- `annotator_date_pub`: an updated publication data
|
228 |
+
- `annotator_normalised_date_pub`: normalized version of the above
|
229 |
+
- `annotator_edition_statement` updated edition
|
230 |
+
- `annotator_FAST_genre_terms`: [FAST classification genre terms](https://www.oclc.org/research/areas/data-science/fast.html)
|
231 |
+
- `annotator_FAST_subject_terms`: [FAST subject terms](https://www.oclc.org/research/areas/data-science/fast.html)
|
232 |
+
- `annotator_comments`: free form comments
|
233 |
+
- `annotator_main_language`
|
234 |
+
- `annotator_other_languages_summaries`
|
235 |
+
- `'annotator_summaries_language`
|
236 |
+
- `annotator_translation`
|
237 |
+
- `annotator_original_language`
|
238 |
+
- `annotator_publisher`
|
239 |
+
- `annotator_place_pub`
|
240 |
+
- `annotator_country`
|
241 |
+
- `annotator_title`
|
242 |
+
- `Link to digitised book`
|
243 |
+
- `annotated`: `bool` flag to indicate if row has annotations or not
|
244 |
+
- `created_at`: when the annotation was created
|
245 |
+
- `annotator_genre`: the updated annotation for the `genre` of the book.
|
246 |
+
|
247 |
+
Finally the `label` field of the `title_genre_classifiction` configuration is a class label with values 0 (Fiction) or 1 (Non-fiction).
|
248 |
+
|
249 |
+
[More Information Needed]
|
250 |
+
|
251 |
+
### Data Splits
|
252 |
+
|
253 |
+
This dataset contains a single split `train`.
|
254 |
+
|
255 |
+
## Dataset Creation
|
256 |
+
|
257 |
+
**Note** this section is a work in progress.
|
258 |
+
|
259 |
+
### Curation Rationale
|
260 |
+
|
261 |
+
The books in this collection were digitised as part of a project partnership between the British Library and Microsoft. [Mass digitisation](https://en.wikipedia.org/wiki/Category:Mass_digitization) i.e. projects where there is a goal to quickly digitise large volumes of materials shape the selection of materials to include in a number of ways. Some consideratoins which are often involved in the decision of whether to include items for digitization include (but are not limited to):
|
262 |
+
|
263 |
+
- copyright status
|
264 |
+
- preservation needs- the size of an item, very large and very small items are often hard to digitize quickly
|
265 |
+
|
266 |
+
These criteria can have knock-on effects on the makeup of a collection. For example systematically excluding large books may result in some types of book content not being digitized. Large volumes are likely to be correlated to content to at least some extent so excluding them from digitization will mean that material is under represented. Similarly copyright status is often (but not only) determined by publication data. This can often lead to a rapid fall in the number of items in a collection after a certain cut-off date.
|
267 |
+
|
268 |
+
All of the above is largely to make clear that this collection was not curated with the aim of creating a representative sample of the British Library's holdings. Some material will be over-represented and other under-represented. Similarly, the collection should not be considered a representative sample of what was published across the time period covered by the dataset (nor that that the relative proportions of the data for each time period represent a proportional sample of publications from that period).
|
269 |
+
|
270 |
+
[More Information Needed]
|
271 |
+
|
272 |
+
### Source Data
|
273 |
+
|
274 |
+
The original source data (physical items) includes a variety of resources (predominantly monographs) held by the [British Library](bl.uk/](https://bl.uk/). The British Library is a [Legal Deposit](https://www.bl.uk/legal-deposit/about-legal-deposit) library. "Legal deposit requires publishers to provide a copy of every work they publish in the UK to the British Library. It's existed in English law since 1662."[source](https://www.bl.uk/legal-deposit/about-legal-deposit).
|
275 |
+
|
276 |
+
[More Information Needed]
|
277 |
+
|
278 |
+
#### Initial Data Collection and Normalization
|
279 |
+
|
280 |
+
This version of the dataset was created partially from data exported from British Library catalogue records and partially via data generated from a crowdsourcing task involving British Library staff.
|
281 |
+
|
282 |
+
#### Who are the source language producers?
|
283 |
+
|
284 |
+
[More Information Needed]
|
285 |
+
|
286 |
+
### Annotations
|
287 |
+
|
288 |
+
The data does includes metadata associated with the books these are produced by British Library staff. The additional annotations were carried out during 2020 as part of an internal crowdsourcing task.
|
289 |
+
|
290 |
+
#### Annotation process
|
291 |
+
|
292 |
+
New annotations were produced via a crowdsourcing tasks. Annotators have the option to pick titles from a particular language subset from the broader digitized 19th century books collection. As a result the annotations are not random and overrepresent some languages.
|
293 |
+
|
294 |
+
[More Information Needed]
|
295 |
+
|
296 |
+
#### Who are the annotators?
|
297 |
+
|
298 |
+
Staff working at the British Library. Most of these staff work with metadata as part of their jobs and so could be considered expert annotators.
|
299 |
+
|
300 |
+
[More Information Needed]
|
301 |
+
|
302 |
+
### Personal and Sensitive Information
|
303 |
+
|
304 |
+
[More Information Needed]
|
305 |
+
|
306 |
+
## Considerations for Using the Data
|
307 |
+
|
308 |
+
There a range of considerations around using the data. These include the representativeness of the dataset, the bias towards particular languages etc.
|
309 |
+
|
310 |
+
It is also important to note that library metadata is not static. The metadata held in library catalogues is updated and changed over time for a variety of reasons.
|
311 |
+
|
312 |
+
The way in which different institutions catalogue items also varies. As a result it is important to evaluate the performance of any models trained on this data before applying to a new collection.
|
313 |
+
|
314 |
+
[More Information Needed]
|
315 |
+
|
316 |
+
### Social Impact of Dataset
|
317 |
+
|
318 |
+
[More Information Needed]
|
319 |
+
|
320 |
+
### Discussion of Biases
|
321 |
+
|
322 |
+
The text in this collection is derived from historic text. As a result the text will reflect to social beliefs and attitudes of this time period. The titles of the book give some sense of their content. Examples of book titles which appear in the data (these are randomly sampled from all titles):
|
323 |
+
|
324 |
+
- 'Rhymes and Dreams, Legends of Pendle Forest, and other poems',
|
325 |
+
- "Précis of Information concerning the Zulu Country, with a map. Prepared in the Intelligence Branch of the Quarter-Master-General's Department, Horse Guards, War Office, etc",
|
326 |
+
- 'The fan. A poem',
|
327 |
+
- 'Grif; a story of Australian Life',
|
328 |
+
- 'Calypso; a masque: in three acts, etc',
|
329 |
+
- 'Tales Uncle told [With illustrative woodcuts.]',
|
330 |
+
- 'Questings',
|
331 |
+
- 'Home Life on an Ostrich Farm. With ... illustrations',
|
332 |
+
- 'Bulgarya i Bulgarowie',
|
333 |
+
- 'Εἰς τα βαθη της Ἀφρικης [In darkest Africa.] ... Μεταφρασις Γεωρ. Σ. Βουτσινα, etc',
|
334 |
+
- 'The Corsair, a tale',
|
335 |
+
'Poems ... With notes [With a portrait.]',
|
336 |
+
- 'Report of the Librarian for the year 1898 (1899, 1901, 1909)',
|
337 |
+
- "The World of Thought. A novel. By the author of 'Before I began to speak.'",
|
338 |
+
- 'Amleto; tragedia ... recata in versi italiani da M. Leoni, etc']
|
339 |
+
|
340 |
+
Whilst using titles alone, is obviously insufficient to integrate bias in this collection it gives some insight into the topics covered by books in the corpus. Further looking into the tiles highlight some particular types of bias we might find in the collection. This should in no way be considered an exhaustive list.
|
341 |
+
|
342 |
+
#### Colonialism
|
343 |
+
|
344 |
+
We can see even in the above random sample of titles examples of colonial attitudes. We can try and interrogate this further by searching for the name of countries which were part of the British Empire at the time many of these books were published.
|
345 |
+
|
346 |
+
Searching for the string `India` in the titles and randomly sampling 10 titles returns:
|
347 |
+
|
348 |
+
- "Travels in India in the Seventeenth Century: by Sir Thomas Roe and Dr. John Fryer. Reprinted from the 'Calcutta Weekly Englishman.'",
|
349 |
+
- 'A Winter in India and Malaysia among the Methodist Missions',
|
350 |
+
- "The Tourist's Guide to all the principal stations on the railways of Northern India [By W. W.] ... Fifth edition",
|
351 |
+
- 'Records of Sport and Military Life in Western India ... With an introduction by ... G. B. Malleson',
|
352 |
+
- "Lakhmi, the Rájpút's Bride. A tale of Gujarát in Western India [A poem.]",
|
353 |
+
- 'The West India Commonplace Book: compiled from parliamentary and official documents; shewing the interest of Great Britain in its Sugar Colonies',
|
354 |
+
- "From Tonkin to India : by the sources of the Irawadi, January '95-January '96",
|
355 |
+
- 'Case of the Ameers of Sinde : speeches of Mr. John Sullivan, and Captain William Eastwick, at a special court held at the India House, ... 26th January, 1844',
|
356 |
+
- 'The Andaman Islands; their colonization, etc. A correspondence addressed to the India Office',
|
357 |
+
- 'Ancient India as described by Ptolemy; being a translation of the chapters which describe India and Eastern Asia in the treatise on Geography written by Klaudios Ptolemaios ... with introduction, commentary, map of India according to Ptolemy, and ... index, by J. W. McCrindle']
|
358 |
+
|
359 |
+
Searching form the string `Africa` in the titles and randomly sampling 10 titles returns:
|
360 |
+
|
361 |
+
- ['De Benguella ás Terras de Iácca. Descripção de uma viagem na Africa Central e Occidental ... Expedição organisada nos annos de 1877-1880. Edição illustrada',
|
362 |
+
- 'To the New Geographical Society of Edinburgh [An address on Africa by H. M. Stanley.]',
|
363 |
+
- 'Diamonds and Gold in South Africa ... With maps, etc',
|
364 |
+
- 'Missionary Travels and Researches in South Africa ... With notes by F. S. Arnot. With map and illustrations. New edition',
|
365 |
+
- 'A Narrative of a Visit to the Mauritius and South Africa ... Illustrated by two maps, sixteen etchings and twenty-eight wood-cuts',
|
366 |
+
- 'Side Lights on South Africa ... With a map, etc',
|
367 |
+
- 'My Second Journey through Equatorial Africa ... in ... 1886 and 1887 ... Translated ... by M. J. A. Bergmann. With a map ... and ... illustrations, etc',
|
368 |
+
- 'Missionary Travels and Researches in South Africa ... With portrait and fullpage illustrations',
|
369 |
+
- '[African sketches.] Narrative of a residence in South Africa ... A new edition. To which is prefixed a biographical sketch of the author by J. Conder',
|
370 |
+
- 'Lake Ngami; or, Explorations and discoveries during four years wandering in the wilds of South Western Africa ... With a map, and numerous illustrations, etc']
|
371 |
+
|
372 |
+
Whilst this dataset doesn't include the underlying text it is important to consider the potential attitudes represented in the title of the books, or the full text if you are using this dataset in conjunction with the full text.
|
373 |
+
|
374 |
+
[More Information Needed]
|
375 |
+
|
376 |
+
### Other Known Limitations
|
377 |
+
|
378 |
+
[More Information Needed]
|
379 |
+
|
380 |
+
## Additional Information
|
381 |
+
|
382 |
+
### Dataset Curators
|
383 |
+
|
384 |
+
[More Information Needed]
|
385 |
+
|
386 |
+
### Licensing Information
|
387 |
+
|
388 |
+
The books are licensed under the [CC Public Domain Mark 1.0](https://creativecommons.org/publicdomain/mark/1.0/) license.
|
389 |
+
|
390 |
+
### Citation Information
|
391 |
+
|
392 |
+
```bibtex
|
393 |
+
@misc{british library_genre,
|
394 |
+
title={ 19th Century Books - metadata with additional crowdsourced annotations},
|
395 |
+
url={https://doi.org/10.23636/BKHQ-0312},
|
396 |
+
author={{British Library} and Morris, Victoria and van Strien, Daniel and Tolfo, Giorgia and Afric, Lora and Robertson, Stewart and Tiney, Patricia and Dogterom, Annelies and Wollner, Ildi},
|
397 |
+
year={2021}}
|
398 |
+
```
|
399 |
+
|
400 |
+
### Contributions
|
401 |
+
|
402 |
+
Thanks to [@davanstrien](https://github.com/davanstrien) for adding this dataset.
|
blbooksgenre.py
ADDED
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""British Library Books Genre Dataset"""
|
16 |
+
|
17 |
+
import ast
|
18 |
+
import csv
|
19 |
+
from datetime import datetime
|
20 |
+
from typing import Dict, List
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
_CITATION = """\
|
26 |
+
@misc{british library_genre,
|
27 |
+
title={ 19th Century Books - metadata with additional crowdsourced annotations},
|
28 |
+
url={https://doi.org/10.23636/BKHQ-0312},
|
29 |
+
author={{British Library} and Morris, Victoria and van Strien, Daniel and Tolfo, Giorgia and Afric, Lora and Robertson, Stewart and Tiney, Patricia and Dogterom, Annelies and Wollner, Ildi},
|
30 |
+
year={2021}}
|
31 |
+
"""
|
32 |
+
|
33 |
+
_DESCRIPTION = """\
|
34 |
+
This dataset contains metadata for resources belonging to the British Library’s digitised printed books (18th-19th century) collection (bl.uk/collection-guides/digitised-printed-books).
|
35 |
+
This metadata has been extracted from British Library catalogue records.
|
36 |
+
The metadata held within our main catalogue is updated regularly.
|
37 |
+
This metadata dataset should be considered a snapshot of this metadata.
|
38 |
+
"""
|
39 |
+
|
40 |
+
_HOMEPAGE = "doi.org/10.23636/BKHQ-0312"
|
41 |
+
|
42 |
+
_LICENSE = "CC0 1.0 Universal Public Domain"
|
43 |
+
|
44 |
+
|
45 |
+
_URL = "https://bl.iro.bl.uk/downloads/36c7cd20-c8a7-4495-acbe-469b9132c6b1?locale=en"
|
46 |
+
|
47 |
+
common_features = {
|
48 |
+
"BL record ID": datasets.Value("string"),
|
49 |
+
"Name": datasets.Value("string"),
|
50 |
+
"Dates associated with name": datasets.Value("string"),
|
51 |
+
"Type of name": datasets.Value("string"),
|
52 |
+
"Role": datasets.Value("string"),
|
53 |
+
"All names": datasets.features.Sequence(datasets.Value("string")),
|
54 |
+
"Title": datasets.Value("string"),
|
55 |
+
"Variant titles": datasets.Value("string"),
|
56 |
+
"Series title": datasets.Value("string"),
|
57 |
+
"Number within series": datasets.Value("string"),
|
58 |
+
"Country of publication": datasets.Sequence(datasets.Value("string")),
|
59 |
+
"Place of publication": datasets.Sequence(datasets.Value("string")),
|
60 |
+
"Publisher": datasets.Value("string"),
|
61 |
+
"Date of publication": datasets.Value("string"),
|
62 |
+
"Edition": datasets.Value("string"),
|
63 |
+
"Physical description": datasets.Value("string"),
|
64 |
+
"Dewey classification": datasets.Value("string"),
|
65 |
+
"BL shelfmark": datasets.Value("string"),
|
66 |
+
"Topics": datasets.Value("string"),
|
67 |
+
"Genre": datasets.Value("string"),
|
68 |
+
"Languages": datasets.features.Sequence(datasets.Value("string")),
|
69 |
+
"Notes": datasets.Value("string"),
|
70 |
+
"BL record ID for physical resource": datasets.Value("string"),
|
71 |
+
"classification_id": datasets.Value("string"),
|
72 |
+
"user_id": datasets.Value("string"),
|
73 |
+
"subject_ids": datasets.Value("string"),
|
74 |
+
"annotator_date_pub": datasets.Value("string"),
|
75 |
+
"annotator_normalised_date_pub": datasets.Value("string"),
|
76 |
+
"annotator_edition_statement": datasets.Value("string"),
|
77 |
+
"annotator_FAST_genre_terms": datasets.Value("string"),
|
78 |
+
"annotator_FAST_subject_terms": datasets.Value("string"),
|
79 |
+
"annotator_comments": datasets.Value("string"),
|
80 |
+
"annotator_main_language": datasets.Value("string"),
|
81 |
+
"annotator_other_languages_summaries": datasets.Value("string"),
|
82 |
+
"annotator_summaries_language": datasets.Value("string"),
|
83 |
+
"annotator_translation": datasets.Value("string"),
|
84 |
+
"annotator_original_language": datasets.Value("string"),
|
85 |
+
"annotator_publisher": datasets.Value("string"),
|
86 |
+
"annotator_place_pub": datasets.Value("string"),
|
87 |
+
"annotator_country": datasets.Value("string"),
|
88 |
+
"annotator_title": datasets.Value("string"),
|
89 |
+
"Link to digitised book": datasets.Value("string"),
|
90 |
+
"annotated": datasets.Value("bool"),
|
91 |
+
}
|
92 |
+
|
93 |
+
raw_features = datasets.Features(
|
94 |
+
{
|
95 |
+
**common_features,
|
96 |
+
**{
|
97 |
+
"Type of resource": datasets.features.ClassLabel(
|
98 |
+
names=["Monograph", "Serial", "Monographic component part"]
|
99 |
+
),
|
100 |
+
"created_at": datasets.Value("string"),
|
101 |
+
"annotator_genre": datasets.Value("string"),
|
102 |
+
},
|
103 |
+
}
|
104 |
+
)
|
105 |
+
|
106 |
+
annotated_raw_features = datasets.Features(
|
107 |
+
{
|
108 |
+
**common_features,
|
109 |
+
**{
|
110 |
+
"Type of resource": datasets.features.ClassLabel(
|
111 |
+
names=[
|
112 |
+
"Monograph",
|
113 |
+
"Serial",
|
114 |
+
]
|
115 |
+
),
|
116 |
+
"created_at": datasets.Value("timestamp[s]"),
|
117 |
+
"annotator_genre": datasets.features.ClassLabel(
|
118 |
+
names=[
|
119 |
+
"Fiction",
|
120 |
+
"Can't tell",
|
121 |
+
"Non-fiction",
|
122 |
+
"The book contains both Fiction and Non-Fiction",
|
123 |
+
]
|
124 |
+
),
|
125 |
+
},
|
126 |
+
}
|
127 |
+
)
|
128 |
+
|
129 |
+
|
130 |
+
class BlBooksGenre(datasets.GeneratorBasedBuilder):
|
131 |
+
|
132 |
+
VERSION = datasets.Version("1.1.0")
|
133 |
+
BUILDER_CONFIGS = [
|
134 |
+
datasets.BuilderConfig(
|
135 |
+
name="title_genre_classifiction",
|
136 |
+
version=VERSION,
|
137 |
+
description="This part of my dataset covers a first domain",
|
138 |
+
),
|
139 |
+
datasets.BuilderConfig(
|
140 |
+
name="annotated_raw",
|
141 |
+
version=VERSION,
|
142 |
+
description="""\
|
143 |
+
This version of the dataset includes all fields from the original dataset which are annotated.
|
144 |
+
This includes duplication from different annotators""",
|
145 |
+
),
|
146 |
+
datasets.BuilderConfig(
|
147 |
+
name="raw",
|
148 |
+
version=VERSION,
|
149 |
+
description="""\
|
150 |
+
This version of the dataset includes all the fields from the original dataset including rows without annotation.
|
151 |
+
It includes duplications from different annotators""",
|
152 |
+
),
|
153 |
+
]
|
154 |
+
|
155 |
+
DEFAULT_CONFIG_NAME = "title_genre_classifiction"
|
156 |
+
|
157 |
+
def _info(self):
|
158 |
+
if self.config.name == "title_genre_classifiction":
|
159 |
+
features = datasets.Features(
|
160 |
+
{
|
161 |
+
"BL record ID": datasets.Value("string"),
|
162 |
+
"title": datasets.Value("string"),
|
163 |
+
"label": datasets.features.ClassLabel(names=["Fiction", "Non-fiction"]),
|
164 |
+
}
|
165 |
+
)
|
166 |
+
if self.config.name == "annotated_raw":
|
167 |
+
features = annotated_raw_features
|
168 |
+
if self.config.name == "raw":
|
169 |
+
features = raw_features
|
170 |
+
|
171 |
+
return datasets.DatasetInfo(
|
172 |
+
description=_DESCRIPTION,
|
173 |
+
features=features,
|
174 |
+
supervised_keys=None,
|
175 |
+
homepage=_HOMEPAGE,
|
176 |
+
license=_LICENSE,
|
177 |
+
citation=_CITATION,
|
178 |
+
)
|
179 |
+
|
180 |
+
def _split_generators(self, dl_manager):
|
181 |
+
"""Returns SplitGenerators."""
|
182 |
+
|
183 |
+
data_file = dl_manager.download(_URL)
|
184 |
+
return [
|
185 |
+
datasets.SplitGenerator(
|
186 |
+
name=datasets.Split.TRAIN,
|
187 |
+
# These kwargs will be passed to _generate_examples
|
188 |
+
gen_kwargs={
|
189 |
+
"filepath": data_file,
|
190 |
+
"split": "train",
|
191 |
+
},
|
192 |
+
),
|
193 |
+
]
|
194 |
+
|
195 |
+
def _parse_language(self, row: Dict) -> List[str]:
|
196 |
+
languages = row["Languages"]
|
197 |
+
if not languages:
|
198 |
+
return []
|
199 |
+
return languages.split(";")
|
200 |
+
|
201 |
+
def _parse_country(self, row: Dict) -> List[str]:
|
202 |
+
return row["Country of publication"].split(";") if row["Country of publication"] else []
|
203 |
+
|
204 |
+
def _parse_place_of_publication(self, row: Dict) -> List[str]:
|
205 |
+
return row["Place of publication"].split(";") if row["Place of publication"] else []
|
206 |
+
|
207 |
+
def _parse_all_names(self, row: Dict) -> List[str]:
|
208 |
+
return row["All names"].split(";") if row["All names"] else []
|
209 |
+
|
210 |
+
def _generate_examples(self, filepath, split):
|
211 |
+
"""Yields examples as (key, example) tuples."""
|
212 |
+
with open(filepath, encoding="utf-8") as f:
|
213 |
+
reader = csv.DictReader(f)
|
214 |
+
if self.config.name == "title_genre_classifiction":
|
215 |
+
unique = set()
|
216 |
+
id_ = 0
|
217 |
+
for row in reader:
|
218 |
+
annotated = ast.literal_eval(row["annotated"])
|
219 |
+
if not annotated:
|
220 |
+
continue
|
221 |
+
label = row["annotator_genre"]
|
222 |
+
if label not in {"Fiction", "Non-fiction"}:
|
223 |
+
continue
|
224 |
+
title = row["Title"]
|
225 |
+
if title in unique:
|
226 |
+
continue
|
227 |
+
unique.add(title)
|
228 |
+
id_ += 1
|
229 |
+
yield id_, {
|
230 |
+
"BL record ID": row["BL record ID"],
|
231 |
+
"title": title,
|
232 |
+
"label": label,
|
233 |
+
}
|
234 |
+
if self.config.name == "annotated_raw":
|
235 |
+
id_ = 0
|
236 |
+
for row in reader:
|
237 |
+
annotated = ast.literal_eval(row["annotated"])
|
238 |
+
if not annotated:
|
239 |
+
continue
|
240 |
+
created_at = datetime.strptime(row["created_at"], "%Y-%m-%d %H:%M:%S %Z")
|
241 |
+
id_ += 1
|
242 |
+
yield id_, {
|
243 |
+
"BL record ID": row["BL record ID"],
|
244 |
+
"Type of resource": row["Type of resource"],
|
245 |
+
"Name": row["Name"],
|
246 |
+
"Dates associated with name": row["Dates associated with name"],
|
247 |
+
"Type of name": row["Type of name"],
|
248 |
+
"Role": row["Role"],
|
249 |
+
"All names": self._parse_all_names(row),
|
250 |
+
"Title": row["Title"],
|
251 |
+
"Variant titles": row["Variant titles"],
|
252 |
+
"Series title": row["Series title"],
|
253 |
+
"Number within series": row["Number within series"],
|
254 |
+
"Country of publication": self._parse_country(row),
|
255 |
+
"Place of publication": self._parse_place_of_publication(row),
|
256 |
+
"Publisher": row["Publisher"],
|
257 |
+
"Date of publication": row["Date of publication"],
|
258 |
+
"Edition": row["Edition"],
|
259 |
+
"Physical description": row["Physical description"],
|
260 |
+
"Dewey classification": row["Dewey classification"],
|
261 |
+
"BL shelfmark": row["BL shelfmark"],
|
262 |
+
"Topics": row["Topics"],
|
263 |
+
"Genre": row["Genre"],
|
264 |
+
"Languages": self._parse_language(row),
|
265 |
+
"Notes": row["Notes"],
|
266 |
+
"BL record ID for physical resource": row["BL record ID for physical resource"],
|
267 |
+
"classification_id": row["classification_id"],
|
268 |
+
"user_id": row["user_id"],
|
269 |
+
"created_at": created_at,
|
270 |
+
"subject_ids": row["subject_ids"],
|
271 |
+
"annotator_date_pub": row["annotator_date_pub"],
|
272 |
+
"annotator_normalised_date_pub": row["annotator_normalised_date_pub"],
|
273 |
+
"annotator_edition_statement": row["annotator_edition_statement"],
|
274 |
+
"annotator_genre": row["annotator_genre"],
|
275 |
+
"annotator_FAST_genre_terms": row["annotator_FAST_genre_terms"],
|
276 |
+
"annotator_FAST_subject_terms": row["annotator_FAST_subject_terms"],
|
277 |
+
"annotator_comments": row["annotator_comments"],
|
278 |
+
"annotator_main_language": row["annotator_main_language"],
|
279 |
+
"annotator_other_languages_summaries": row["annotator_other_languages_summaries"],
|
280 |
+
"annotator_summaries_language": row["annotator_summaries_language"],
|
281 |
+
"annotator_translation": row["annotator_translation"],
|
282 |
+
"annotator_original_language": row["annotator_original_language"],
|
283 |
+
"annotator_publisher": row["annotator_publisher"],
|
284 |
+
"annotator_place_pub": row["annotator_place_pub"],
|
285 |
+
"annotator_country": row["annotator_country"],
|
286 |
+
"annotator_title": row["annotator_title"],
|
287 |
+
"Link to digitised book": row["Link to digitised book"],
|
288 |
+
"annotated": annotated,
|
289 |
+
}
|
290 |
+
if self.config.name == "raw":
|
291 |
+
for id_, row in enumerate(reader):
|
292 |
+
|
293 |
+
yield id_, {
|
294 |
+
"BL record ID": row["BL record ID"],
|
295 |
+
"Type of resource": row["Type of resource"],
|
296 |
+
"Name": row["Name"],
|
297 |
+
"Dates associated with name": row["Dates associated with name"],
|
298 |
+
"Type of name": row["Type of name"],
|
299 |
+
"Role": row["Role"],
|
300 |
+
"All names": self._parse_all_names(row),
|
301 |
+
"Title": row["Title"],
|
302 |
+
"Variant titles": row["Variant titles"],
|
303 |
+
"Series title": row["Series title"],
|
304 |
+
"Number within series": row["Number within series"],
|
305 |
+
"Country of publication": self._parse_country(row),
|
306 |
+
"Place of publication": self._parse_place_of_publication(row),
|
307 |
+
"Publisher": row["Publisher"],
|
308 |
+
"Date of publication": row["Date of publication"],
|
309 |
+
"Edition": row["Edition"],
|
310 |
+
"Physical description": row["Physical description"],
|
311 |
+
"Dewey classification": row["Dewey classification"],
|
312 |
+
"BL shelfmark": row["BL shelfmark"],
|
313 |
+
"Topics": row["Topics"],
|
314 |
+
"Genre": row["Genre"],
|
315 |
+
"Languages": self._parse_language(row),
|
316 |
+
"Notes": row["Notes"],
|
317 |
+
"BL record ID for physical resource": row["BL record ID for physical resource"],
|
318 |
+
"classification_id": row["classification_id"],
|
319 |
+
"user_id": row["user_id"],
|
320 |
+
"created_at": row["created_at"],
|
321 |
+
"subject_ids": row["subject_ids"],
|
322 |
+
"annotator_date_pub": row["annotator_date_pub"],
|
323 |
+
"annotator_normalised_date_pub": row["annotator_normalised_date_pub"],
|
324 |
+
"annotator_edition_statement": row["annotator_edition_statement"],
|
325 |
+
"annotator_genre": row["annotator_genre"],
|
326 |
+
"annotator_FAST_genre_terms": row["annotator_FAST_genre_terms"],
|
327 |
+
"annotator_FAST_subject_terms": row["annotator_FAST_subject_terms"],
|
328 |
+
"annotator_comments": row["annotator_comments"],
|
329 |
+
"annotator_main_language": row["annotator_main_language"],
|
330 |
+
"annotator_other_languages_summaries": row["annotator_other_languages_summaries"],
|
331 |
+
"annotator_summaries_language": row["annotator_summaries_language"],
|
332 |
+
"annotator_translation": row["annotator_translation"],
|
333 |
+
"annotator_original_language": row["annotator_original_language"],
|
334 |
+
"annotator_publisher": row["annotator_publisher"],
|
335 |
+
"annotator_place_pub": row["annotator_place_pub"],
|
336 |
+
"annotator_country": row["annotator_country"],
|
337 |
+
"annotator_title": row["annotator_title"],
|
338 |
+
"Link to digitised book": row["Link to digitised book"],
|
339 |
+
"annotated": ast.literal_eval(row["annotated"]),
|
340 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"title_genre_classifiction": {"description": "This dataset contains metadata for resources belonging to the British Library\u2019s digitised printed books (18th-19th century) collection (bl.uk/collection-guides/digitised-printed-books).\nThis metadata has been extracted from British Library catalogue records.\nThe metadata held within our main catalogue is updated regularly.\nThis metadata dataset should be considered a snapshot of this metadata.\n", "citation": "@misc{british library_genre,\ntitle={ 19th Century Books - metadata with additional crowdsourced annotations},\nurl={https://doi.org/10.23636/BKHQ-0312},\nauthor={{British Library} and Morris, Victoria and van Strien, Daniel and Tolfo, Giorgia and Afric, Lora and Robertson, Stewart and Tiney, Patricia and Dogterom, Annelies and Wollner, Ildi},\nyear={2021}}\n", "homepage": "doi.org/10.23636/BKHQ-0312", "license": "CC0 1.0 Universal Public Domain", "features": {"BL record ID": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["Fiction", "Non-fiction"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "bl_books_genre", "config_name": "title_genre_classifiction", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 187600, "num_examples": 1736, "dataset_name": "bl_books_genre"}}, "download_checksums": {"https://bl.iro.bl.uk/downloads/36c7cd20-c8a7-4495-acbe-469b9132c6b1?locale=en": {"num_bytes": 20111420, "checksum": "79b6e09e29bb41b5a5e959134d977b3408eaee786810931d5cfc949135bfcabe"}}, "download_size": 20111420, "post_processing_size": null, "dataset_size": 187600, "size_in_bytes": 20299020}, "annotated_raw": {"description": "This dataset contains metadata for resources belonging to the British Library\u2019s digitised printed books (18th-19th century) collection (bl.uk/collection-guides/digitised-printed-books).\nThis metadata has been extracted from British Library catalogue records.\nThe metadata held within our main catalogue is updated regularly.\nThis metadata dataset should be considered a snapshot of this metadata.\n", "citation": "@misc{british library_genre,\ntitle={ 19th Century Books - metadata with additional crowdsourced annotations},\nurl={https://doi.org/10.23636/BKHQ-0312},\nauthor={{British Library} and Morris, Victoria and van Strien, Daniel and Tolfo, Giorgia and Afric, Lora and Robertson, Stewart and Tiney, Patricia and Dogterom, Annelies and Wollner, Ildi},\nyear={2021}}\n", "homepage": "doi.org/10.23636/BKHQ-0312", "license": "CC0 1.0 Universal Public Domain", "features": {"BL record ID": {"dtype": "string", "id": null, "_type": "Value"}, "Name": {"dtype": "string", "id": null, "_type": "Value"}, "Dates associated with name": {"dtype": "string", "id": null, "_type": "Value"}, "Type of name": {"dtype": "string", "id": null, "_type": "Value"}, "Role": {"dtype": "string", "id": null, "_type": "Value"}, "All names": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Title": {"dtype": "string", "id": null, "_type": "Value"}, "Variant titles": {"dtype": "string", "id": null, "_type": "Value"}, "Series title": {"dtype": "string", "id": null, "_type": "Value"}, "Number within series": {"dtype": "string", "id": null, "_type": "Value"}, "Country of publication": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Place of publication": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Publisher": {"dtype": "string", "id": null, "_type": "Value"}, "Date of publication": {"dtype": "string", "id": null, "_type": "Value"}, "Edition": {"dtype": "string", "id": null, "_type": "Value"}, "Physical description": {"dtype": "string", "id": null, "_type": "Value"}, "Dewey classification": {"dtype": "string", "id": null, "_type": "Value"}, "BL shelfmark": {"dtype": "string", "id": null, "_type": "Value"}, "Topics": {"dtype": "string", "id": null, "_type": "Value"}, "Genre": {"dtype": "string", "id": null, "_type": "Value"}, "Languages": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Notes": {"dtype": "string", "id": null, "_type": "Value"}, "BL record ID for physical resource": {"dtype": "string", "id": null, "_type": "Value"}, "classification_id": {"dtype": "string", "id": null, "_type": "Value"}, "user_id": {"dtype": "string", "id": null, "_type": "Value"}, "subject_ids": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_date_pub": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_normalised_date_pub": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_edition_statement": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_FAST_genre_terms": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_FAST_subject_terms": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_comments": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_main_language": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_other_languages_summaries": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_summaries_language": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_translation": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_original_language": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_publisher": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_place_pub": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_country": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_title": {"dtype": "string", "id": null, "_type": "Value"}, "Link to digitised book": {"dtype": "string", "id": null, "_type": "Value"}, "annotated": {"dtype": "bool", "id": null, "_type": "Value"}, "Type of resource": {"num_classes": 2, "names": ["Monograph", "Serial"], "names_file": null, "id": null, "_type": "ClassLabel"}, "created_at": {"dtype": "timestamp[s]", "id": null, "_type": "Value"}, "annotator_genre": {"num_classes": 4, "names": ["Fiction", "Can't tell", "Non-fiction", "The book contains both Fiction and Non-Fiction"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "bl_books_genre", "config_name": "annotated_raw", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3583138, "num_examples": 4398, "dataset_name": "bl_books_genre"}}, "download_checksums": {"https://bl.iro.bl.uk/downloads/36c7cd20-c8a7-4495-acbe-469b9132c6b1?locale=en": {"num_bytes": 20111420, "checksum": "79b6e09e29bb41b5a5e959134d977b3408eaee786810931d5cfc949135bfcabe"}}, "download_size": 20111420, "post_processing_size": null, "dataset_size": 3583138, "size_in_bytes": 23694558}, "raw": {"description": "This dataset contains metadata for resources belonging to the British Library\u2019s digitised printed books (18th-19th century) collection (bl.uk/collection-guides/digitised-printed-books).\nThis metadata has been extracted from British Library catalogue records.\nThe metadata held within our main catalogue is updated regularly.\nThis metadata dataset should be considered a snapshot of this metadata.\n", "citation": "@misc{british library_genre,\ntitle={ 19th Century Books - metadata with additional crowdsourced annotations},\nurl={https://doi.org/10.23636/BKHQ-0312},\nauthor={{British Library} and Morris, Victoria and van Strien, Daniel and Tolfo, Giorgia and Afric, Lora and Robertson, Stewart and Tiney, Patricia and Dogterom, Annelies and Wollner, Ildi},\nyear={2021}}\n", "homepage": "doi.org/10.23636/BKHQ-0312", "license": "CC0 1.0 Universal Public Domain", "features": {"BL record ID": {"dtype": "string", "id": null, "_type": "Value"}, "Name": {"dtype": "string", "id": null, "_type": "Value"}, "Dates associated with name": {"dtype": "string", "id": null, "_type": "Value"}, "Type of name": {"dtype": "string", "id": null, "_type": "Value"}, "Role": {"dtype": "string", "id": null, "_type": "Value"}, "All names": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Title": {"dtype": "string", "id": null, "_type": "Value"}, "Variant titles": {"dtype": "string", "id": null, "_type": "Value"}, "Series title": {"dtype": "string", "id": null, "_type": "Value"}, "Number within series": {"dtype": "string", "id": null, "_type": "Value"}, "Country of publication": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Place of publication": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Publisher": {"dtype": "string", "id": null, "_type": "Value"}, "Date of publication": {"dtype": "string", "id": null, "_type": "Value"}, "Edition": {"dtype": "string", "id": null, "_type": "Value"}, "Physical description": {"dtype": "string", "id": null, "_type": "Value"}, "Dewey classification": {"dtype": "string", "id": null, "_type": "Value"}, "BL shelfmark": {"dtype": "string", "id": null, "_type": "Value"}, "Topics": {"dtype": "string", "id": null, "_type": "Value"}, "Genre": {"dtype": "string", "id": null, "_type": "Value"}, "Languages": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "Notes": {"dtype": "string", "id": null, "_type": "Value"}, "BL record ID for physical resource": {"dtype": "string", "id": null, "_type": "Value"}, "classification_id": {"dtype": "string", "id": null, "_type": "Value"}, "user_id": {"dtype": "string", "id": null, "_type": "Value"}, "subject_ids": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_date_pub": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_normalised_date_pub": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_edition_statement": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_FAST_genre_terms": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_FAST_subject_terms": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_comments": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_main_language": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_other_languages_summaries": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_summaries_language": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_translation": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_original_language": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_publisher": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_place_pub": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_country": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_title": {"dtype": "string", "id": null, "_type": "Value"}, "Link to digitised book": {"dtype": "string", "id": null, "_type": "Value"}, "annotated": {"dtype": "bool", "id": null, "_type": "Value"}, "Type of resource": {"num_classes": 3, "names": ["Monograph", "Serial", "Monographic component part"], "names_file": null, "id": null, "_type": "ClassLabel"}, "created_at": {"dtype": "string", "id": null, "_type": "Value"}, "annotator_genre": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "bl_books_genre", "config_name": "raw", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 27518816, "num_examples": 55343, "dataset_name": "bl_books_genre"}}, "download_checksums": {"https://bl.iro.bl.uk/downloads/36c7cd20-c8a7-4495-acbe-469b9132c6b1?locale=en": {"num_bytes": 20111420, "checksum": "79b6e09e29bb41b5a5e959134d977b3408eaee786810931d5cfc949135bfcabe"}}, "download_size": 20111420, "post_processing_size": null, "dataset_size": 27518816, "size_in_bytes": 47630236}}
|
dummy/annotated_raw/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4d8a39a01c2862abc8326f5661d951f392d3a8aae8aee2a939b9b8d6cdc513d
|
3 |
+
size 23577
|
dummy/raw/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ddf42d5ca5c7a4bf77c613e8e59443335a89b62b6cb2006078b9d075e3fd9ce
|
3 |
+
size 23577
|
dummy/title_genre_classifiction/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4aac48c09212c5924d75b8bc504db3c15b9589823c979649cb168653e5ab2661
|
3 |
+
size 23577
|