--- license: odc-by language: - bn pretty_name: BanglaDocIndex size_categories: - 10M` (one gzipped WARC record holding the PDF) | | `live` | `source_url` on the original website; it may have changed or gone (check `pdf_sha256`) | Page `page_number` (1-based) of that PDF is page `-p`. Pages were rendered at 150 DPI, never above a scan's native resolution (`native_dpi`), at most 8 MP, as RGB JPEG quality 88. ## Tables All tables also carry `ingest_run_id` (the run that wrote the row; see `core/runs/`) and `schema_version`. ### `pages`: one row per page | Column | Meaning | |---|---| | `page_id` | `-pNNNNNN`, 1-based page number | | `doc_id`, `source`, `page_number` | the document and the page's position in it | | `width`, `height`, `dpi`, `native_dpi` | rendered size in pixels, rendering DPI, the scan's own DPI (scans only) | | `render_recipe` | rendering recipe, defined in `core/recipes/.json` | | `image_sha256`, `phash` | SHA-256 of the rendered JPEG and a 64-bit perceptual hash (DCT), to check rebuilt images | | `split` | `train` / `val` / `test` (90 / 5 / 5 %), assigned per document from a hash, so all pages of a document share a split | | `shard_key`, `member`, `offset`, `length` | location in the private image archive. Not publicly resolvable; kept so the files are identical to the archive's catalog. `shard_key` names the embedding file | ### `documents`: one row per PDF | Column | Meaning | |---|---| | `doc_id` | hash of source, source item and file name | | `source`, `source_item_id`, `source_filename` | e.g. `ia`, the Internet Archive identifier, the PDF's file name | | `source_url`, `fetch_method`, `warc_path`, `warc_offset`, `warc_length` | where the PDF was fetched (see above) | | `title`, `creator`, `pub_year`, `language` | descriptive metadata, as given by the source | | `pdf_bytes`, `pdf_sha256`, `source_md5` | the fetched PDF's size and hash, and the source's own checksum where published | | `page_count` | pages in the PDF | | `duplicate_of` | set when an identical PDF was already catalogued; its pages are not repeated | | `license_url`, `rights_raw` | licence and rights statements from the source, verbatim | | `source_metadata` | the source's metadata record for this file (JSON) | | `kept_pdf_shard`, `kept_pdf_offset`, `kept_pdf_length` | copy of the PDF in the private archive (live websites and NCTB). Not publicly resolvable | | `split` | as in `pages` | ### `embeddings`: one row per page | Column | Meaning | |---|---| | `page_id` | joins with `pages` | | `embedding` | 768 × float16, L2-normalised | Model `google/embeddinggemma-2` through `sentence-transformers`, image input, a budget of 70 image tokens per page, bfloat16 on an NVIDIA L4. Large scans were decoded at reduced JPEG scale with the long side at least 1,536 px before the model's own resize (cosine similarity to full-size decoding: mean 1.000, 1st percentile ≥ 0.995 on a test set). The folder name records the model, the token budget and the version (`model=…/tokens=70/v=1`), so embeddings made with other settings can sit beside these later. ### `source_items`: everything discovered One row per item the discovery step looked at, whether or not it produced a document: `status` is `accepted`, `no_pdf`, `skipped` or `error`. It includes the script composition of the item's text where the source provides one (`script_bengali`, `script_latin`, …, `script_method`) and the source's metadata record verbatim (`raw_metadata`, JSON). **An item that failed and was retried has one row per attempt** (1,775 Internet Archive items, mostly HTTP 500 and 401 responses); the row with the latest `checked_at` is the final status. ### `shards`: the archive's tar files One row per page or PDF tar in the private archive (`kind` = `pages` or `pdfs`), with size, SHA-256, MD5 and member count (two members per page: the JPEG and a small JSON). Useful mainly to map an embedding file to its pages. ### Other files | Path | Content | |---|---| | `core/recipes/*.json` | the rendering recipe: DPI rule, pixel cap, JPEG settings, pdfium / Pillow / libjpeg-turbo versions | | `core/runs/*.json` | one record per ingestion run: code commit, settings, counters | | `core/sources/finepdfs/manifest-*.parquet` | the FinePDFs `ben_Beng` document list this index started from | ## Licensing The index itself (catalog, metadata compilation and embeddings) is released under the [Open Data Commons Attribution License (ODC-By) 1.0](https://opendatacommons.org/licenses/by/1-0/), the licence also used by FineWeb and FinePDFs. Please credit BanglaDocIndex and its sources. The source documents are **not** part of this release and keep their own licences. What their sources state, by pages: | Licence stated by the source | Documents | Pages | |---|---:|---:| | Public domain mark / CC0 (Internet Archive) | 5,088 | 1,172,077 | | CC BY / CC BY-SA (Internet Archive) | 153 | 7,574 | | Non-commercial CC (NC, without ND) (Internet Archive) | 249 | 40,890 | | No-derivatives CC (ND) (Internet Archive) | 1,662 | 354,183 | | NCTB textbooks (government free distribution) | 109 | 16,729 | | Not stated (Internet Archive) | 60,950 | 15,122,488 | | Not stated (FinePDFs: web PDFs; see FinePDFs' terms) | 457,407 | 3,159,477 | `documents.license_url` and `documents.rights_raw` hold the statements per document. Anyone who rebuilds page images is responsible for respecting the licence of each document. The embeddings were produced with `google/embeddinggemma-2`, which is provided under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). **Removal requests.** If you are a rights holder and want a document removed from the index, open an issue at [github.com/OpenCR-lab/BanglaDocIndex/issues](https://github.com/OpenCR-lab/BanglaDocIndex/issues) with the `doc_id` or source URL. ## How it was built 1. **Discovery.** Internet Archive: every item tagged Bengali, kept when at least 80% of its text's letters are Bengali script. FinePDFs: every `ben_Beng` document. NCTB: the 2026 secondary textbooks (classes 6–10). 2. **Fetching.** Internet Archive and NCTB over HTTP; FinePDFs from the Common Crawl WARC record when the crawl stored the whole PDF, otherwise from the live website. Byte-identical PDFs are catalogued once (`duplicate_of`). 3. **Rendering.** pypdfium2, one JPEG per page (recipe above). Pages pdfium could not render are left out; they show up as gaps in `page_number`. 4. **Catalog.** A row reaches the catalog only after its page images are safely stored. 5. **Embedding.** Every page image, on Colab L4 GPUs. Ingestion ran 2026-10-23 to 2026-10-28 on Google Cloud; embedding finished 2026-11-12. The code, design record and operating notes are on [GitHub](https://github.com/OpenCR-lab/BanglaDocIndex). ## Known limitations - **Mostly Internet Archive.** 84% of pages come from Internet Archive scans, many of them older books; modern born-digital documents come mainly from FinePDFs. - **Live documents can disappear.** 2.02M pages were fetched from the original websites; some of those PDFs will change or vanish, so their images may no longer be rebuildable. - **Licences are mostly unstated.** Most sources give no licence; see the table above. - **Metadata as given.** Titles, creators and years come from the sources unchanged and are incomplete (`pub_year` is set for 48,434 documents). - **Catalog correction.** One catalog part (3,001 pages of one shard) was written twice after a crash during ingestion; the duplicate was removed before release. ## Citation ```bibtex @misc{ashraf2026bangladocindex, title = {BanglaDocIndex: An Index of 19.9 Million Bangla Document Pages}, author = {Ashraf, Nafis}, year = {2026}, howpublished = {\url{https://huggingface.co/datasets/OpenCR-lab/BanglaDocIndex}} } ```