Datasets:
Tasks:
Text Generation
Size:
10K - 100K
Update README.md
Browse files
README.md
CHANGED
|
@@ -171,35 +171,33 @@ for example in dataset:
|
|
| 171 |
"reading_time": 1,
|
| 172 |
"format": null,
|
| 173 |
"complexity": null,
|
| 174 |
-
"comments":
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
11653541
|
| 186 |
-
]
|
| 187 |
-
},
|
| 188 |
-
{
|
| 189 |
-
"id": 11653541,
|
| 190 |
-
"parent_id": 11653537,
|
| 191 |
-
"level": 1,
|
| 192 |
-
"time_published": 1185967886,
|
| 193 |
-
"score": 0,
|
| 194 |
-
"votes": 0,
|
| 195 |
-
"message_html": "...",
|
| 196 |
-
"message_markdown": "...",
|
| 197 |
-
"author": "..."
|
| 198 |
-
}
|
| 199 |
-
]
|
| 200 |
}
|
| 201 |
```
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
|
| 204 |
## Source Data
|
| 205 |
|
|
|
|
| 171 |
"reading_time": 1,
|
| 172 |
"format": null,
|
| 173 |
"complexity": null,
|
| 174 |
+
"comments": {
|
| 175 |
+
"id": [11653537, 11653541],
|
| 176 |
+
"parent_id": [null, 11653537],
|
| 177 |
+
"level": [0, 1],
|
| 178 |
+
"time_published": [1185963192, 1185967886],
|
| 179 |
+
"score": [-1, 0],
|
| 180 |
+
"votes": [1, 0],
|
| 181 |
+
"message_html": ["...", "..."],
|
| 182 |
+
"author": ["...", "..."],
|
| 183 |
+
"children": [[11653541], []]
|
| 184 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
}
|
| 186 |
```
|
| 187 |
|
| 188 |
+
You can use this little helper to unflatten sequences:
|
| 189 |
+
|
| 190 |
+
```python
|
| 191 |
+
def revert_flattening(records):
|
| 192 |
+
fixed_records = []
|
| 193 |
+
for key, values in records.items():
|
| 194 |
+
if not fixed_records:
|
| 195 |
+
fixed_records = [{} for _ in range(len(values))]
|
| 196 |
+
for i, value in enumerate(values):
|
| 197 |
+
fixed_records[i][key] = value
|
| 198 |
+
return fixed_records
|
| 199 |
+
```
|
| 200 |
+
|
| 201 |
|
| 202 |
## Source Data
|
| 203 |
|