added cleaning info
Browse files
README.md
CHANGED
|
@@ -49,6 +49,17 @@ All questions Bill Wurtz answers on [billwurtz.com/questions](https://billwurtz.
|
|
| 49 |
- π For tasks: `text-generation`, `question-answering`, + more
|
| 50 |
- π Rows: `129,362` (129k)
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
Download with [π€ Datasets](https://pypi.org/project/datasets):
|
| 53 |
|
| 54 |
```python
|
|
@@ -58,3 +69,29 @@ dataset = load_dataset("AWeirdDev/bill-wurtz")
|
|
| 58 |
dataset["train"][0]
|
| 59 |
# => { "link": "...", "question": "your opinion on ceilings?", "answer": "incredible" }
|
| 60 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
- π For tasks: `text-generation`, `question-answering`, + more
|
| 50 |
- π Rows: `129,362` (129k)
|
| 51 |
|
| 52 |
+
```python
|
| 53 |
+
DatasetDict({
|
| 54 |
+
train: Dataset({
|
| 55 |
+
features: ['link', 'question', 'answer'],
|
| 56 |
+
num_rows: 129362
|
| 57 |
+
})
|
| 58 |
+
})
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Use This Dataset
|
| 62 |
+
|
| 63 |
Download with [π€ Datasets](https://pypi.org/project/datasets):
|
| 64 |
|
| 65 |
```python
|
|
|
|
| 69 |
dataset["train"][0]
|
| 70 |
# => { "link": "...", "question": "your opinion on ceilings?", "answer": "incredible" }
|
| 71 |
```
|
| 72 |
+
|
| 73 |
+
<details>
|
| 74 |
+
<summary><b>π§Ή Cleaning the dataset</b></summary>
|
| 75 |
+
<p>
|
| 76 |
+
|
| 77 |
+
Some questions/answers may be blank. Clean the dataset before you use it.
|
| 78 |
+
|
| 79 |
+
```python
|
| 80 |
+
from datasets import Dataset
|
| 81 |
+
|
| 82 |
+
raw_dataset = dataset["train"].to_list()
|
| 83 |
+
|
| 84 |
+
for i, d in enumerate(raw_dataset):
|
| 85 |
+
if not d['question'].strip() or not d['answer'].strip():
|
| 86 |
+
del raw_dataset[i]
|
| 87 |
+
|
| 88 |
+
raw_dataset = Dataset.from_list(raw_dataset)
|
| 89 |
+
raw_dataset
|
| 90 |
+
# Dataset({
|
| 91 |
+
# features: ['link', 'question', 'answer'],
|
| 92 |
+
# num_rows: 123922
|
| 93 |
+
# })
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
</p>
|
| 97 |
+
</details>
|