Download materialize.py from answerdotai/simplewiki: direct link, hf CLI and curl.
- Browser
- Download file 239 Bytes
-
https://huggingface.co/datasets/answerdotai/simplewiki/resolve/main/materialize.py
- Command line
-
hf download hf://datasets/answerdotai/simplewiki/materialize.py
-
curl -L -o materialize.py https://huggingface.co/datasets/answerdotai/simplewiki/resolve/main/materialize.py
239 Bytes
| "Reconstruct chunk text from the two dataset configurations." | |
| def materialize(article, chunk): | |
| body = article["md"].encode() | |
| start = chunk["start_byte"] | |
| return chunk["prefix_md"] + body[start:start+chunk["byte_len"]].decode() | |