wjbmattingly
commited on
Commit
•
76ed5a3
1
Parent(s):
14c3376
Update README.md
Browse files
README.md
CHANGED
@@ -1,20 +1,93 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
dataset_info:
|
4 |
-
features:
|
5 |
-
- name: rg
|
6 |
-
dtype: string
|
7 |
-
- name: html
|
8 |
-
dtype: string
|
9 |
-
splits:
|
10 |
-
- name: train
|
11 |
-
num_bytes: 126620379
|
12 |
-
num_examples: 949
|
13 |
-
download_size: 53587059
|
14 |
-
dataset_size: 126620379
|
15 |
-
configs:
|
16 |
-
- config_name: default
|
17 |
-
data_files:
|
18 |
-
- split: train
|
19 |
-
path: data/train-*
|
20 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
dataset_info:
|
4 |
+
features:
|
5 |
+
- name: rg
|
6 |
+
dtype: string
|
7 |
+
- name: html
|
8 |
+
dtype: string
|
9 |
+
splits:
|
10 |
+
- name: train
|
11 |
+
num_bytes: 126620379
|
12 |
+
num_examples: 949
|
13 |
+
download_size: 53587059
|
14 |
+
dataset_size: 126620379
|
15 |
+
configs:
|
16 |
+
- config_name: default
|
17 |
+
data_files:
|
18 |
+
- split: train
|
19 |
+
path: data/train-*
|
20 |
+
---
|
21 |
+
|
22 |
+
# Holocaust Survivor Testimonies Dataset
|
23 |
+
|
24 |
+
This dataset contains a collection of Holocaust survivor testimonies from the United States Holocaust Memorial Museum (USHMM). The testimonies are presented in an unconventional HTML format, which is temporary and will be further processed in future iterations.
|
25 |
+
|
26 |
+
## Dataset Structure
|
27 |
+
|
28 |
+
Each item in the dataset consists of two fields:
|
29 |
+
|
30 |
+
1. `rg`: A unique identifier for each testimony, corresponding to the original filename without the extension.
|
31 |
+
2. `html`: The content of the testimony in HTML format.
|
32 |
+
|
33 |
+
## HTML Structure
|
34 |
+
|
35 |
+
The HTML content is structured as follows:
|
36 |
+
|
37 |
+
- The document starts with a standard HTML5 doctype and structure.
|
38 |
+
- The main content is enclosed in `<body>` tags.
|
39 |
+
- Each dialogue element (question or answer) is wrapped in `<dialogue>` tags with a class attribute indicating whether it's a "Question" or "Answer".
|
40 |
+
- The text content is further wrapped in `<p>` tags within the `<dialogue>` tags.
|
41 |
+
Example:
|
42 |
+
```html
|
43 |
+
<!DOCTYPE html>
|
44 |
+
|
45 |
+
<html lang="en">
|
46 |
+
<head>
|
47 |
+
<meta charset="utf-8"/>
|
48 |
+
<title>Document</title>
|
49 |
+
</head>
|
50 |
+
<body><dialogue class=""><p><p>DAVID KOCHALSKI July 28, 1994</p></p></dialogue>
|
51 |
+
<dialogue class=""><p></p></dialogue><dialogue class="Question"><p><p>Q: I need you to start off by telling me your name, place of birth, and date of birth?</p></p></dialogue>
|
52 |
+
<dialogue class=""><p></p></dialogue><dialogue class="Answer"><p><p>A: My name David Kochalski. I was born in a small town called , and I was born May 5, 1928.</p></p></dialogue>
|
53 |
+
<dialogue class=""><p></p></dialogue><dialogue class="Question"><p><p>Q: Tell me a little bit about your family life before the war?</p></p></dialogue>
|
54 |
+
```
|
55 |
+
|
56 |
+
- There are `<span>` elements with class "page-break" used to identify page breaks within the text. These elements include a "number" attribute indicating the page number.
|
57 |
+
|
58 |
+
Example:
|
59 |
+
```html
|
60 |
+
<dialogue class="Answer">
|
61 |
+
<p>
|
62 |
+
<p>A: Yes, I did. I felt it, maybe not personally, but I knew of a lot of incidents whereby either they were small little -- I would call it -- we were separated, in other words, but hardly got together, and there were incidents. Incidents, not pleasant incidents, because we were <span class="page-break" number="0"></span> called in from the house, people regardless of how religious we were, did not believe that we were really religious people.</p>
|
63 |
+
</p>
|
64 |
+
</dialogue>
|
65 |
+
```
|
66 |
+
|
67 |
+
## Example of Finding all the Questions:
|
68 |
+
|
69 |
+
```python
|
70 |
+
from datasets import load_dataset
|
71 |
+
from bs4 import BeautifulSoup
|
72 |
+
|
73 |
+
# Load the dataset from Hugging Face
|
74 |
+
dataset = load_dataset("placingholocaust/testimonies-1k", split="train").take(1)
|
75 |
+
|
76 |
+
# Function to extract questions from HTML content
|
77 |
+
def extract_questions(html_content):
|
78 |
+
soup = BeautifulSoup(html_content, 'html.parser')
|
79 |
+
questions = soup.find_all('dialogue', class_='Question')
|
80 |
+
return [q.get_text(strip=True) for q in questions]
|
81 |
+
|
82 |
+
# Iterate through the dataset and print questions
|
83 |
+
for item in dataset:
|
84 |
+
rg = item['rg']
|
85 |
+
html_content = item['html']
|
86 |
+
|
87 |
+
questions = extract_questions(html_content)
|
88 |
+
|
89 |
+
print(f"Questions from testimony {rg}:")
|
90 |
+
for i, question in enumerate(questions, 1):
|
91 |
+
print(f"{i}. {question}")
|
92 |
+
print("\n")
|
93 |
+
```
|