Datasets:
Add files using upload-large-folder tool
Browse files- README.md +103 -0
- data/train.lance/_indices/96e45e4e-59d7-4e3f-9fd0-8e83abc12b01/metadata.lance +0 -0
- data/train.lance/_indices/96e45e4e-59d7-4e3f-9fd0-8e83abc12b01/part_0_docs.lance +0 -0
- data/train.lance/_indices/96e45e4e-59d7-4e3f-9fd0-8e83abc12b01/part_0_tokens.lance +0 -0
- data/train.lance/_indices/b719f540-65f3-43d3-90ca-398bb6df64b4/page_lookup.lance +0 -0
- data/train.lance/_indices/ce595477-96b1-4764-9cfd-ac161f83f4d3/metadata.lance +0 -0
- data/train.lance/_indices/ce595477-96b1-4764-9cfd-ac161f83f4d3/part_0_docs.lance +0 -0
- data/train.lance/_indices/ce595477-96b1-4764-9cfd-ac161f83f4d3/part_0_tokens.lance +0 -0
- data/train.lance/_indices/cf20c377-22d7-44ba-9843-35a2a8e8e3aa/page_lookup.lance +0 -0
- data/train.lance/_indices/f0788b0b-3131-4098-85f6-b290c59adcac/page_data.lance +0 -0
- data/train.lance/_indices/f0788b0b-3131-4098-85f6-b290c59adcac/page_lookup.lance +0 -0
- data/train.lance/_transactions/0-a19d76b5-3092-4aee-abbe-3fcdead61514.txn +0 -0
- data/train.lance/_transactions/1-5c257ee5-e90e-45f4-a466-372752ef0a24.txn +0 -0
- data/train.lance/_transactions/2-a4e512ea-9081-4e20-bd0f-86b3149dc2d5.txn +0 -0
- data/train.lance/_transactions/3-6d9d0fc4-0825-47ce-a1c8-6c34890ea1ba.txn +0 -0
- data/train.lance/_transactions/4-bba97dbc-bb5d-4367-8c2d-e217fda953ca.txn +0 -0
- data/train.lance/_transactions/5-9fd74148-3c47-41ed-bc22-5f9747c4967c.txn +0 -0
- data/train.lance/_transactions/6-396cc1b3-0c56-496b-b2da-0db9884b1951.txn +0 -0
- data/train.lance/_transactions/7-37f0a3e9-ea96-4068-9b68-771a767ce535.txn +0 -0
- data/train.lance/_versions/18446744073709551607.manifest +0 -0
- data/train.lance/_versions/18446744073709551608.manifest +0 -0
- data/train.lance/_versions/18446744073709551609.manifest +0 -0
- data/train.lance/_versions/18446744073709551610.manifest +0 -0
- data/train.lance/_versions/18446744073709551611.manifest +0 -0
- data/train.lance/_versions/18446744073709551612.manifest +0 -0
- data/train.lance/_versions/18446744073709551613.manifest +0 -0
- data/train.lance/_versions/18446744073709551614.manifest +0 -0
- data/validation.lance/_indices/10bb2ae9-63c8-4819-86c1-81800882441c/metadata.lance +0 -0
- data/validation.lance/_indices/10bb2ae9-63c8-4819-86c1-81800882441c/part_0_docs.lance +0 -0
- data/validation.lance/_indices/10bb2ae9-63c8-4819-86c1-81800882441c/part_0_tokens.lance +0 -0
- data/validation.lance/_indices/ce2d7b31-64cb-455c-8d8c-f07dd4a8659a/page_data.lance +0 -0
- data/validation.lance/_indices/ce2d7b31-64cb-455c-8d8c-f07dd4a8659a/page_lookup.lance +0 -0
- data/validation.lance/_indices/d67418dd-203a-4475-b845-0fd8477d5589/index.idx +0 -0
- data/validation.lance/_indices/faec4487-3418-44eb-bdc0-6955b133ee13/index.idx +0 -0
- data/validation.lance/_transactions/0-fecc178e-63df-47d3-84b2-df12164f3bad.txn +0 -0
- data/validation.lance/_transactions/1-ef72e0e1-3095-47ef-8ee3-c043a342800c.txn +0 -0
- data/validation.lance/_transactions/2-1a1c932e-f139-4a30-86c1-1fd1dddbf916.txn +0 -0
- data/validation.lance/_transactions/3-15c45579-f4d3-4530-8d07-47e214d6a419.txn +0 -0
- data/validation.lance/_transactions/4-92467d7a-e96f-46d8-9591-72b968e19f2c.txn +0 -0
- data/validation.lance/_transactions/5-dc4f227b-d753-4f13-be62-d74373aa5615.txn +0 -0
- data/validation.lance/_transactions/6-579717cc-a8be-43eb-87bf-752a75e3ef19.txn +0 -0
- data/validation.lance/_transactions/7-560908cb-392c-479b-afb8-6bbd696eae50.txn +0 -0
- data/validation.lance/_versions/18446744073709551607.manifest +0 -0
- data/validation.lance/_versions/18446744073709551608.manifest +0 -0
- data/validation.lance/_versions/18446744073709551609.manifest +0 -0
- data/validation.lance/_versions/18446744073709551610.manifest +0 -0
- data/validation.lance/_versions/18446744073709551611.manifest +0 -0
- data/validation.lance/_versions/18446744073709551612.manifest +0 -0
- data/validation.lance/_versions/18446744073709551613.manifest +0 -0
- data/validation.lance/_versions/18446744073709551614.manifest +0 -0
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- visual-question-answering
|
| 5 |
+
- image-text-to-text
|
| 6 |
+
- image-feature-extraction
|
| 7 |
+
language:
|
| 8 |
+
- en
|
| 9 |
+
tags:
|
| 10 |
+
- textvqa
|
| 11 |
+
- ocr
|
| 12 |
+
- vqa
|
| 13 |
+
- vision-language
|
| 14 |
+
- lance
|
| 15 |
+
- clip-embeddings
|
| 16 |
+
pretty_name: textvqa-lance
|
| 17 |
+
size_categories:
|
| 18 |
+
- 10K<n<100K
|
| 19 |
+
---
|
| 20 |
+
# TextVQA (Lance Format)
|
| 21 |
+
|
| 22 |
+
Lance-formatted version of [TextVQA](https://textvqa.org/) — VQA where the question requires *reading* text in the image — sourced from [`lmms-lab/textvqa`](https://huggingface.co/datasets/lmms-lab/textvqa).
|
| 23 |
+
|
| 24 |
+
Each row carries the image bytes, the question, the 10 reference answers, the OCR tokens detected by the dataset's pre-processing, and CLIP image + question embeddings.
|
| 25 |
+
|
| 26 |
+
## Splits
|
| 27 |
+
|
| 28 |
+
| Split | Rows |
|
| 29 |
+
|-------|------|
|
| 30 |
+
| `validation.lance` | 5,000 |
|
| 31 |
+
| `train.lance` | 34,602 |
|
| 32 |
+
|
| 33 |
+
## Schema
|
| 34 |
+
|
| 35 |
+
| Column | Type | Notes |
|
| 36 |
+
|---|---|---|
|
| 37 |
+
| `id` | `int64` | Row index within split |
|
| 38 |
+
| `image` | `large_binary` | Inline JPEG bytes |
|
| 39 |
+
| `image_id` | `string?` | TextVQA image id |
|
| 40 |
+
| `question_id` | `string?` | TextVQA question id |
|
| 41 |
+
| `question` | `string` | The question text |
|
| 42 |
+
| `answers` | `list<string>` | 10 annotator answers |
|
| 43 |
+
| `answer` | `string` | First answer — used as canonical / FTS target |
|
| 44 |
+
| `ocr_tokens` | `list<string>` | OCR tokens detected on the image |
|
| 45 |
+
| `image_classes` | `list<string>` | OpenImages-style scene tags from the source |
|
| 46 |
+
| `set_name` | `string?` | Source partition (`train`, `val`) |
|
| 47 |
+
| `image_emb` | `fixed_size_list<float32, 512>` | OpenCLIP image embedding (cosine-normalized) |
|
| 48 |
+
| `question_emb` | `fixed_size_list<float32, 512>` | OpenCLIP text embedding of the question |
|
| 49 |
+
|
| 50 |
+
## Pre-built indices
|
| 51 |
+
|
| 52 |
+
- `IVF_PQ` on `image_emb` and `question_emb` — `metric=cosine`
|
| 53 |
+
- `INVERTED` (FTS) on `question` and `answer`
|
| 54 |
+
- `BTREE` on `image_id`, `question_id`, `set_name`
|
| 55 |
+
|
| 56 |
+
## Quick start
|
| 57 |
+
|
| 58 |
+
```python
|
| 59 |
+
import lance
|
| 60 |
+
ds = lance.dataset("hf://datasets/lance-format/textvqa-lance/data/validation.lance")
|
| 61 |
+
print(ds.count_rows(), ds.schema.names, ds.list_indices())
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Cross-modal text→image search
|
| 65 |
+
|
| 66 |
+
```python
|
| 67 |
+
import lance, pyarrow as pa, open_clip, torch
|
| 68 |
+
|
| 69 |
+
model, _, _ = open_clip.create_model_and_transforms("ViT-B-32", pretrained="laion2b_s34b_b79k")
|
| 70 |
+
tokenizer = open_clip.get_tokenizer("ViT-B-32")
|
| 71 |
+
model = model.eval().cuda().half()
|
| 72 |
+
with torch.no_grad():
|
| 73 |
+
q = model.encode_text(tokenizer(["what brand is on this billboard?"]).cuda())
|
| 74 |
+
q = (q / q.norm(dim=-1, keepdim=True)).float().cpu().numpy()[0]
|
| 75 |
+
|
| 76 |
+
ds = lance.dataset("hf://datasets/lance-format/textvqa-lance/data/validation.lance")
|
| 77 |
+
emb_field = ds.schema.field("image_emb")
|
| 78 |
+
hits = ds.scanner(
|
| 79 |
+
nearest={"column": "image_emb", "q": pa.array([q.tolist()], type=emb_field.type)[0], "k": 10},
|
| 80 |
+
columns=["question", "answer", "ocr_tokens"],
|
| 81 |
+
).to_table().to_pylist()
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
## Why Lance?
|
| 85 |
+
|
| 86 |
+
- One dataset for images + questions + answers + OCR + dual embeddings + indices — no JSON/feature folders.
|
| 87 |
+
- Cross-modal search and OCR-text filtering work on the same dataset on the Hub.
|
| 88 |
+
- Schema evolution: add columns (alternate OCR systems, model predictions) without rewriting the data.
|
| 89 |
+
|
| 90 |
+
## Source & license
|
| 91 |
+
|
| 92 |
+
Converted from [`lmms-lab/textvqa`](https://huggingface.co/datasets/lmms-lab/textvqa). TextVQA is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) by Singh et al. (Facebook AI Research).
|
| 93 |
+
|
| 94 |
+
## Citation
|
| 95 |
+
|
| 96 |
+
```
|
| 97 |
+
@inproceedings{singh2019towards,
|
| 98 |
+
title={Towards VQA models that can read},
|
| 99 |
+
author={Singh, Amanpreet and Natarajan, Vivek and Shah, Meet and Jiang, Yu and Chen, Xinlei and Batra, Dhruv and Parikh, Devi and Rohrbach, Marcus},
|
| 100 |
+
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
|
| 101 |
+
year={2019}
|
| 102 |
+
}
|
| 103 |
+
```
|
data/train.lance/_indices/96e45e4e-59d7-4e3f-9fd0-8e83abc12b01/metadata.lance
ADDED
|
Binary file (733 Bytes). View file
|
|
|
data/train.lance/_indices/96e45e4e-59d7-4e3f-9fd0-8e83abc12b01/part_0_docs.lance
ADDED
|
Binary file (82.6 kB). View file
|
|
|
data/train.lance/_indices/96e45e4e-59d7-4e3f-9fd0-8e83abc12b01/part_0_tokens.lance
ADDED
|
Binary file (94.7 kB). View file
|
|
|
data/train.lance/_indices/b719f540-65f3-43d3-90ca-398bb6df64b4/page_lookup.lance
ADDED
|
Binary file (1.4 kB). View file
|
|
|
data/train.lance/_indices/ce595477-96b1-4764-9cfd-ac161f83f4d3/metadata.lance
ADDED
|
Binary file (733 Bytes). View file
|
|
|
data/train.lance/_indices/ce595477-96b1-4764-9cfd-ac161f83f4d3/part_0_docs.lance
ADDED
|
Binary file (85 kB). View file
|
|
|
data/train.lance/_indices/ce595477-96b1-4764-9cfd-ac161f83f4d3/part_0_tokens.lance
ADDED
|
Binary file (39.1 kB). View file
|
|
|
data/train.lance/_indices/cf20c377-22d7-44ba-9843-35a2a8e8e3aa/page_lookup.lance
ADDED
|
Binary file (1.53 kB). View file
|
|
|
data/train.lance/_indices/f0788b0b-3131-4098-85f6-b290c59adcac/page_data.lance
ADDED
|
Binary file (65.4 kB). View file
|
|
|
data/train.lance/_indices/f0788b0b-3131-4098-85f6-b290c59adcac/page_lookup.lance
ADDED
|
Binary file (1.4 kB). View file
|
|
|
data/train.lance/_transactions/0-a19d76b5-3092-4aee-abbe-3fcdead61514.txn
ADDED
|
Binary file (682 Bytes). View file
|
|
|
data/train.lance/_transactions/1-5c257ee5-e90e-45f4-a466-372752ef0a24.txn
ADDED
|
Binary file (190 Bytes). View file
|
|
|
data/train.lance/_transactions/2-a4e512ea-9081-4e20-bd0f-86b3149dc2d5.txn
ADDED
|
Binary file (193 Bytes). View file
|
|
|
data/train.lance/_transactions/3-6d9d0fc4-0825-47ce-a1c8-6c34890ea1ba.txn
ADDED
|
Binary file (285 Bytes). View file
|
|
|
data/train.lance/_transactions/4-bba97dbc-bb5d-4367-8c2d-e217fda953ca.txn
ADDED
|
Binary file (283 Bytes). View file
|
|
|
data/train.lance/_transactions/5-9fd74148-3c47-41ed-bc22-5f9747c4967c.txn
ADDED
|
Binary file (196 Bytes). View file
|
|
|
data/train.lance/_transactions/6-396cc1b3-0c56-496b-b2da-0db9884b1951.txn
ADDED
|
Binary file (199 Bytes). View file
|
|
|
data/train.lance/_transactions/7-37f0a3e9-ea96-4068-9b68-771a767ce535.txn
ADDED
|
Binary file (196 Bytes). View file
|
|
|
data/train.lance/_versions/18446744073709551607.manifest
ADDED
|
Binary file (2.2 kB). View file
|
|
|
data/train.lance/_versions/18446744073709551608.manifest
ADDED
|
Binary file (2.06 kB). View file
|
|
|
data/train.lance/_versions/18446744073709551609.manifest
ADDED
|
Binary file (1.9 kB). View file
|
|
|
data/train.lance/_versions/18446744073709551610.manifest
ADDED
|
Binary file (1.83 kB). View file
|
|
|
data/train.lance/_versions/18446744073709551611.manifest
ADDED
|
Binary file (1.6 kB). View file
|
|
|
data/train.lance/_versions/18446744073709551612.manifest
ADDED
|
Binary file (1.26 kB). View file
|
|
|
data/train.lance/_versions/18446744073709551613.manifest
ADDED
|
Binary file (1.11 kB). View file
|
|
|
data/train.lance/_versions/18446744073709551614.manifest
ADDED
|
Binary file (1.45 kB). View file
|
|
|
data/validation.lance/_indices/10bb2ae9-63c8-4819-86c1-81800882441c/metadata.lance
ADDED
|
Binary file (733 Bytes). View file
|
|
|
data/validation.lance/_indices/10bb2ae9-63c8-4819-86c1-81800882441c/part_0_docs.lance
ADDED
|
Binary file (10.8 kB). View file
|
|
|
data/validation.lance/_indices/10bb2ae9-63c8-4819-86c1-81800882441c/part_0_tokens.lance
ADDED
|
Binary file (30.7 kB). View file
|
|
|
data/validation.lance/_indices/ce2d7b31-64cb-455c-8d8c-f07dd4a8659a/page_data.lance
ADDED
|
Binary file (55.7 kB). View file
|
|
|
data/validation.lance/_indices/ce2d7b31-64cb-455c-8d8c-f07dd4a8659a/page_lookup.lance
ADDED
|
Binary file (1.27 kB). View file
|
|
|
data/validation.lance/_indices/d67418dd-203a-4475-b845-0fd8477d5589/index.idx
ADDED
|
Binary file (33.1 kB). View file
|
|
|
data/validation.lance/_indices/faec4487-3418-44eb-bdc0-6955b133ee13/index.idx
ADDED
|
Binary file (33.1 kB). View file
|
|
|
data/validation.lance/_transactions/0-fecc178e-63df-47d3-84b2-df12164f3bad.txn
ADDED
|
Binary file (681 Bytes). View file
|
|
|
data/validation.lance/_transactions/1-ef72e0e1-3095-47ef-8ee3-c043a342800c.txn
ADDED
|
Binary file (189 Bytes). View file
|
|
|
data/validation.lance/_transactions/2-1a1c932e-f139-4a30-86c1-1fd1dddbf916.txn
ADDED
|
Binary file (192 Bytes). View file
|
|
|
data/validation.lance/_transactions/3-15c45579-f4d3-4530-8d07-47e214d6a419.txn
ADDED
|
Binary file (284 Bytes). View file
|
|
|
data/validation.lance/_transactions/4-92467d7a-e96f-46d8-9591-72b968e19f2c.txn
ADDED
|
Binary file (282 Bytes). View file
|
|
|
data/validation.lance/_transactions/5-dc4f227b-d753-4f13-be62-d74373aa5615.txn
ADDED
|
Binary file (196 Bytes). View file
|
|
|
data/validation.lance/_transactions/6-579717cc-a8be-43eb-87bf-752a75e3ef19.txn
ADDED
|
Binary file (199 Bytes). View file
|
|
|
data/validation.lance/_transactions/7-560908cb-392c-479b-afb8-6bbd696eae50.txn
ADDED
|
Binary file (195 Bytes). View file
|
|
|
data/validation.lance/_versions/18446744073709551607.manifest
ADDED
|
Binary file (2.2 kB). View file
|
|
|
data/validation.lance/_versions/18446744073709551608.manifest
ADDED
|
Binary file (2.05 kB). View file
|
|
|
data/validation.lance/_versions/18446744073709551609.manifest
ADDED
|
Binary file (1.89 kB). View file
|
|
|
data/validation.lance/_versions/18446744073709551610.manifest
ADDED
|
Binary file (1.83 kB). View file
|
|
|
data/validation.lance/_versions/18446744073709551611.manifest
ADDED
|
Binary file (1.59 kB). View file
|
|
|
data/validation.lance/_versions/18446744073709551612.manifest
ADDED
|
Binary file (1.26 kB). View file
|
|
|
data/validation.lance/_versions/18446744073709551613.manifest
ADDED
|
Binary file (1.11 kB). View file
|
|
|
data/validation.lance/_versions/18446744073709551614.manifest
ADDED
|
Binary file (1.45 kB). View file
|
|
|