Datasets:

Modalities:
Tabular
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
Dask
License:

The "file_path" data field appears to primarily contain cc-index paths rather than WARC paths.

#16
by lnstrument - opened

I tried inspecting the original PDF files and found that many—possibly the majority—of the "file_path" entries point to cc-index Parquet files, while the "offset" values refer to positions within WARC files.

This makes it difficult to download a single PDF file, since we first need to download the entire cc-index file (nearly 1GB) just to locate the corresponding WARC file.

Would it be possible for the team to provide the full WARC paths, offsets, and perhaps lengths for each PDF?

For reference, the two related fields in README.md are:
file_path (string): s3 path for the individual CommonCrawl warc file containing this sample
offset (int): offset in CommonCrawl warc file containg this sample

FineData org

Hi, unfortunately we made a small mistake during the first step and didn't keep the lengths of pdfs inside the WARC-files. Accessing them however, doesn't mean you need to download the full cc-index files. You can seek and then read with prefetching till you read the whole file.

Could anyone please help me implement this function? I have tried many methods. First, the content of cc-index cannot be obtained. The content of crawl-data can be parsed, but I am not sure whether it is complete.

Hi, unfortunately we made a small mistake during the first step and didn't keep the lengths of pdfs inside the WARC-files. Accessing them however, doesn't mean you need to download the full cc-index files. You can seek and then read with prefetching till you read the whole file.

@hynky what's the way to not download the full cc-index files? The dataset provides the path to index file and the offset, however parquet files might not be able to be accessed just at the offset, thus requiring a full download. For data files I can see we should be able to do something like

import fsspec
from fastwarc.warc import ArchiveIterator


fs = fsspec.filesystem("....")

with fs.open(data_path) as f:
    f.seek(offset)
    for record in ArchiveIterator(f): 
         pdf_bytes = record.reader.read()
         write_to_disk(..)
         break

Hi, we have released the github code, which showcases well how get pdfs from CC! Yes there is no need to download full index, you can simply seek and only get relevant parts from CC
https://github.com/huggingface/finepdfs

Hi, we have released the github code, which showcases well how get pdfs from CC! Yes there is no need to download full index, you can simply seek and only get relevant parts from CC
https://github.com/huggingface/finepdfs

Can you spot where is the code you get pdfs from CC exactly?

I can't find it too

This comment has been hidden (marked as Resolved)

Sign up or log in to comment