Datasets:
id int64 0 29.4k | image imagewidth (px) 259 6k | image_id stringlengths 16 16 | question_id stringlengths 1 5 | question stringlengths 10 113 | answers listlengths 10 10 | answer stringlengths 1 411 | image_emb list | question_emb list | ocr_tokens listlengths 0 100 | image_classes listlengths 1 61 | set_name stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0054c91397f2fe05 | 0 | what is the brand of phone? | [
"nokia",
"nokia",
"nokia",
"nokia",
"toshiba",
"nokia",
"nokia",
"nokia",
"nokia",
"nokia"
] | nokia | [
0.0195159912109375,
-0.050384521484375,
-0.0007681846618652344,
-0.01210784912109375,
0.032470703125,
-0.035003662109375,
-0.01739501953125,
0.03240966796875,
-0.003498077392578125,
-0.045501708984375,
0.009185791015625,
-0.01641845703125,
-0.008514404296875,
0.069580078125,
0.0196533203... | [
-0.02545166015625,
-0.039031982421875,
-0.05108642578125,
-0.000946044921875,
-0.0210723876953125,
-0.0010499954223632812,
0.00933837890625,
-0.0609130859375,
-0.0169677734375,
-0.0294036865234375,
-0.05181884765625,
-0.05889892578125,
-0.0018205642700195312,
0.00894927978515625,
-0.0075... | [
"MIA",
"NOKIA"
] | [
"Belt",
"Headphones",
"Goggles",
"Scale",
"Bottle opener",
"Mobile phone",
"Mirror",
"Digital clock",
"Television",
"Telephone",
"Tool",
"Wheel",
"Camera",
"Watch",
"Glasses",
"Aircraft"
] | train | |
1 | 005635e119b9f32f | 1 | what type of plane is this? | [
"lape",
"cargo",
"ec-agg",
"lape",
"lape",
"lape",
"lape",
"lape",
"lape",
"airplane"
] | lape | [
-0.0169219970703125,
-0.07025146484375,
-0.10357666015625,
0.07586669921875,
-0.01450347900390625,
0.044677734375,
0.0242919921875,
-0.01123046875,
0.0048065185546875,
-0.0121612548828125,
-0.00865936279296875,
0.00982666015625,
0.031829833984375,
-0.005779266357421875,
0.020462036132812... | [
0.013214111328125,
-0.038787841796875,
-0.03497314453125,
-0.0303192138671875,
-0.048919677734375,
0.027984619140625,
-0.04022216796875,
-0.0301666259765625,
-0.0021152496337890625,
0.01177215576171875,
0.0014858245849609375,
-0.01209259033203125,
0.039306640625,
0.0199432373046875,
-0.0... | [
"GOELANI",
"LAPE",
"EC-AGG",
"EC",
"AGG"
] | [
"Vehicle",
"Helicopter",
"Airplane",
"Bomb",
"Aircraft"
] | train | |
2 | 005635e119b9f32f | 2 | what are the letters on the tail section of the plane? | [
"ec agg",
"ec-agg",
"ec",
"ec-agg",
"ec",
"ec",
"ec",
"ec",
"ec goeland",
"ec"
] | ec agg | [
-0.0169219970703125,
-0.07025146484375,
-0.10357666015625,
0.07586669921875,
-0.01450347900390625,
0.044677734375,
0.0242919921875,
-0.01123046875,
0.0048065185546875,
-0.0121612548828125,
-0.00865936279296875,
0.00982666015625,
0.031829833984375,
-0.005779266357421875,
0.020462036132812... | [
-0.05810546875,
-0.04046630859375,
0.0005159378051757812,
-0.00008803606033325195,
-0.038330078125,
-0.005764007568359375,
-0.03216552734375,
-0.03289794921875,
0.008392333984375,
-0.0161590576171875,
0.01226043701171875,
0.00423431396484375,
0.042144775390625,
0.0304412841796875,
0.0178... | [
"GOELANI",
"LAPE",
"EC-AGG",
"EC",
"AGG"
] | [
"Vehicle",
"Helicopter",
"Airplane",
"Bomb",
"Aircraft"
] | train | |
3 | 00685bc495504d61 | 3 | who is this copyrighted by? | [
"simon clancy",
"simon ciancy",
"simon clancy",
"simon clancy",
"the brand is bayard",
"simon clancy",
"simon clancy",
"simon clancy",
"simon clancy",
"simon clancy"
] | simon clancy | [
-0.042266845703125,
-0.0989990234375,
-0.0233612060546875,
-0.0172271728515625,
-0.0304718017578125,
-0.037994384765625,
-0.029144287109375,
-0.01496124267578125,
0.0239715576171875,
-0.0250244140625,
0.04290771484375,
-0.01398468017578125,
0.01055908203125,
0.0153045654296875,
-0.000226... | [
0.01406097412109375,
-0.03057861328125,
-0.035614013671875,
-0.00931549072265625,
-0.020538330078125,
-0.024566650390625,
-0.00481414794921875,
-0.0017261505126953125,
-0.01702880859375,
0.0225067138671875,
0.030517578125,
-0.005001068115234375,
0.0092620849609375,
-0.05206298828125,
0.0... | [
"Vingin",
"SONOOOOL",
"VH-VXU",
"Copyright",
"Simon",
"Clancy",
"RWY34.COM"
] | [
"Vehicle",
"Tower",
"Airplane",
"Aircraft"
] | train | |
4 | 00685bc495504d61 | 4 | what brand is on the plane? | [
"virgin is the brand on the plane.",
"virgin mobile",
"virgin",
"virgin",
"virgin",
"virgin",
"virgin",
"virgin",
"virgin",
"virgin"
] | virgin is the brand on the plane. | [
-0.042266845703125,
-0.0989990234375,
-0.0233612060546875,
-0.0172271728515625,
-0.0304718017578125,
-0.037994384765625,
-0.029144287109375,
-0.01496124267578125,
0.0239715576171875,
-0.0250244140625,
0.04290771484375,
-0.01398468017578125,
0.01055908203125,
0.0153045654296875,
-0.000226... | [
-0.04248046875,
-0.0216064453125,
0.01262664794921875,
-0.0247344970703125,
-0.007167816162109375,
0.008148193359375,
-0.01470184326171875,
-0.0300140380859375,
-0.0007414817810058594,
-0.05413818359375,
-0.034271240234375,
-0.008026123046875,
0.038665771484375,
0.00653839111328125,
-0.0... | [
"Vingin",
"SONOOOOL",
"VH-VXU",
"Copyright",
"Simon",
"Clancy",
"RWY34.COM"
] | [
"Vehicle",
"Tower",
"Airplane",
"Aircraft"
] | train | |
5 | 006d10667d17b924 | 5 | what year is shown in the photo? | [
"2011",
"2011",
"2011",
"2011",
"2011",
"2011",
"2011",
"2011",
"2011",
"2011"
] | 2011 | [
0.0134429931640625,
-0.08416748046875,
-0.1583251953125,
0.00963592529296875,
-0.054443359375,
0.01212310791015625,
0.0215911865234375,
-0.02734375,
0.0020923614501953125,
0.0119781494140625,
-0.0190277099609375,
0.01258087158203125,
0.098388671875,
-0.06298828125,
-0.023529052734375,
... | [
-0.0079345703125,
0.0087738037109375,
-0.043914794921875,
-0.00974273681640625,
-0.04254150390625,
0.0005168914794921875,
0.01506805419921875,
-0.050079345703125,
-0.0205230712890625,
-0.0197906494140625,
0.0018157958984375,
-0.0123138427734375,
-0.0111541748046875,
-0.00010645389556884766... | [
"meeny",
"rimini",
"DIVENTA",
"UNA",
"IM",
"H.G.",
"G.ARMIAH",
"VGISTEIZA",
"21.27",
"AGOSTO",
"2011",
"meeting"
] | [
"Person",
"Woman",
"Man",
"Tree",
"Clothing",
"Airplane",
"Human face",
"Aircraft"
] | train | |
6 | 006d10667d17b924 | 6 | what type of meeting is it? | [
"rimini",
"royal theater",
"rimini",
"rimini",
"rimini meeting",
"rimini",
"rimini meeting",
"rimini",
"rimini",
"rimini"
] | rimini | [
0.0134429931640625,
-0.08416748046875,
-0.1583251953125,
0.00963592529296875,
-0.054443359375,
0.01212310791015625,
0.0215911865234375,
-0.02734375,
0.0020923614501953125,
0.0119781494140625,
-0.0190277099609375,
0.01258087158203125,
0.098388671875,
-0.06298828125,
-0.023529052734375,
... | [
-0.019622802734375,
0.003787994384765625,
-0.005146026611328125,
0.035400390625,
-0.04034423828125,
-0.0240020751953125,
0.02783203125,
-0.01367950439453125,
0.0030117034912109375,
-0.04425048828125,
0.00428009033203125,
-0.00679779052734375,
0.0268096923828125,
0.001270294189453125,
0.0... | [
"meeny",
"rimini",
"DIVENTA",
"UNA",
"IM",
"H.G.",
"G.ARMIAH",
"VGISTEIZA",
"21.27",
"AGOSTO",
"2011",
"meeting"
] | [
"Person",
"Woman",
"Man",
"Tree",
"Clothing",
"Airplane",
"Human face",
"Aircraft"
] | train | |
7 | 00c359f294f7dcd9 | 7 | what is the name of this plane? | [
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco"
] | g-atco | [
-0.036468505859375,
0.0255889892578125,
-0.0357666015625,
0.0010290145874023438,
-0.054779052734375,
-0.0153961181640625,
-0.00824737548828125,
0.007740020751953125,
-0.005214691162109375,
0.04840087890625,
-0.0157318115234375,
-0.0019779205322265625,
0.0292205810546875,
0.0087814331054687... | [
-0.008819580078125,
-0.049896240234375,
-0.034912109375,
-0.0364990234375,
-0.04132080078125,
0.036346435546875,
-0.046539306640625,
-0.033782958984375,
0.00879669189453125,
0.004383087158203125,
0.01171875,
-0.004207611083984375,
0.0419921875,
0.016265869140625,
-0.004245758056640625,
... | [
"G-ATCO"
] | [
"Vehicle",
"Helicopter",
"Airplane",
"Aircraft"
] | train | |
8 | 00c359f294f7dcd9 | 8 | what is the plane's call sign? | [
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco",
"g-atco"
] | g-atco | [
-0.036468505859375,
0.0255889892578125,
-0.0357666015625,
0.0010290145874023438,
-0.054779052734375,
-0.0153961181640625,
-0.00824737548828125,
0.007740020751953125,
-0.005214691162109375,
0.04840087890625,
-0.0157318115234375,
-0.0019779205322265625,
0.0292205810546875,
0.0087814331054687... | [
-0.036529541015625,
-0.0401611328125,
-0.0169525146484375,
0.00612640380859375,
-0.04241943359375,
0.01300048828125,
-0.042327880859375,
-0.054534912109375,
0.0156097412109375,
-0.0109710693359375,
-0.0072784423828125,
0.00799560546875,
0.031494140625,
0.0213165283203125,
0.0056266784667... | [
"G-ATCO"
] | [
"Vehicle",
"Helicopter",
"Airplane",
"Aircraft"
] | train | |
9 | 0122c5279a501df2 | 9 | what letter is on the plane's tail? | [
"f",
"f",
"f",
"f",
"f",
"f",
"f",
"f",
"f",
"f"
] | f | [
-0.03997802734375,
-0.253173828125,
-0.08935546875,
-0.0006532669067382812,
-0.042022705078125,
-0.0249176025390625,
-0.0841064453125,
0.040435791015625,
-0.0301513671875,
0.039459228515625,
-0.0173797607421875,
0.0247802734375,
0.01088714599609375,
0.0238189697265625,
-0.023208618164062... | [
-0.033111572265625,
-0.0228729248046875,
0.002918243408203125,
-0.0028095245361328125,
-0.058837890625,
0.0081939697265625,
-0.014190673828125,
-0.033050537109375,
0.0184326171875,
-0.037017822265625,
0.0085296630859375,
0.0087890625,
0.056610107421875,
0.00811767578125,
0.00487518310546... | [] | [
"Vehicle",
"Airplane",
"Aircraft"
] | train |
YAML Metadata Warning:The task_categories "lance" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
TextVQA (Lance Format)
A Lance-formatted version of TextVQA — visual question answering where the question requires reading text in the image (street signs, product labels, screen captures) — sourced from lmms-lab/textvqa. Each row carries the image bytes, the question, the 10 reference annotator answers, the OCR tokens detected by the source pre-processing, OpenImages-style scene tags, and paired CLIP image and question embeddings — all available directly from the Hub at hf://datasets/lance-format/textvqa-lance/data.
Key features
- Inline JPEG bytes in the
imagecolumn — no sidecar files or image folders. - Paired CLIP embeddings in the same row —
image_embandquestion_emb(OpenCLIP ViT-B/32, 512-dim, cosine-normalized) — so cross-modal text→image retrieval is one indexed lookup. - OCR tokens travel with the row in
ocr_tokens, which makes OCR-aware filtering and reranking a single SQL predicate alongside the visual and textual features. - Pre-built ANN, FTS, and scalar indices covering both embeddings, the question and canonical answer, and the source partition.
Splits
| Split | Rows |
|---|---|
validation.lance |
5,000 |
train.lance |
34,602 |
Schema
| Column | Type | Notes |
|---|---|---|
id |
int64 |
Row index within split |
image |
large_binary |
Inline JPEG bytes |
image_id |
string? |
TextVQA image id |
question_id |
string? |
TextVQA question id |
question |
string |
The question text |
answers |
list<string> |
10 annotator answers |
answer |
string |
First annotator answer (used as canonical / FTS target) |
ocr_tokens |
list<string> |
OCR tokens detected on the image |
image_classes |
list<string> |
OpenImages-style scene tags from the source |
set_name |
string? |
Source partition (train, val) |
image_emb |
fixed_size_list<float32, 512> |
OpenCLIP image embedding (cosine-normalized) |
question_emb |
fixed_size_list<float32, 512> |
OpenCLIP text embedding of the question |
Pre-built indices
IVF_PQonimage_emb— image-side vector search (cosine)IVF_PQonquestion_emb— question-side vector search (cosine)INVERTED(FTS) onquestionandanswer— keyword and hybrid searchBTREEonimage_id,question_id,set_name— fast lookup by id and partition
Why Lance?
- Blazing Fast Random Access: Optimized for fetching scattered rows, making it ideal for random sampling, real-time ML serving, and interactive applications without performance degradation.
- Native Multimodal Support: Store text, embeddings, and other data types together in a single file. Large binary objects are loaded lazily, and vectors are optimized for fast similarity search.
- Native Index Support: Lance comes with fast, on-disk, scalable vector and FTS indexes that sit right alongside the dataset on the Hub, so you can share not only your data but also your embeddings and indexes without your users needing to recompute them.
- Efficient Data Evolution: Add new columns and backfill data without rewriting the entire dataset. This is perfect for evolving ML features, adding new embeddings, or introducing moderation tags over time.
- Versatile Querying: Supports combining vector similarity search, full-text search, and SQL-style filtering in a single query, accelerated by on-disk indexes.
- Data Versioning: Every mutation commits a new version; previous versions remain intact on disk. Tags pin a snapshot by name, so retrieval systems and training runs can reproduce against an exact slice of history.
Load with datasets.load_dataset
You can load Lance datasets via the standard HuggingFace datasets interface, suitable when your pipeline already speaks Dataset / IterableDataset or you want a quick streaming sample.
import datasets
hf_ds = datasets.load_dataset("lance-format/textvqa-lance", split="validation", streaming=True)
for row in hf_ds.take(3):
print(row["question"], "->", row["answer"])
Load with LanceDB
LanceDB is the embedded retrieval library built on top of the Lance format (docs), and is the interface most users interact with. It wraps the dataset as a queryable table with search and filter builders, and is the entry point used by the Search, Curate, Evolve, Versioning, and Materialize-a-subset sections below.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/textvqa-lance/data")
tbl = db.open_table("validation")
print(len(tbl))
Load with Lance
pylance is the Python binding for the Lance format and works directly with the format's lower-level APIs. Reach for it when you want to inspect dataset internals — schema, scanner, fragments, and the list of pre-built indices.
import lance
ds = lance.dataset("hf://datasets/lance-format/textvqa-lance/data/validation.lance")
print(ds.count_rows(), ds.schema.names)
print(ds.list_indices())
Tip — for production use, download locally first. Streaming from the Hub works for exploration, but heavy random access and ANN search are far faster against a local copy:
hf download lance-format/textvqa-lance --repo-type dataset --local-dir ./textvqa-lanceThen point Lance or LanceDB at
./textvqa-lance/data.
Search
The bundled IVF_PQ index on image_emb makes cross-modal text→image retrieval a single call: encode a question with the same OpenCLIP model used at ingest (ViT-B/32 laion2b_s34b_b79k, cosine-normalized), then pass the resulting 512-d vector to tbl.search(...) and target image_emb. The example below uses the question_emb already stored in row 42 as a runnable stand-in for "the CLIP encoding of a question", so the snippet works without any model loaded.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/textvqa-lance/data")
tbl = db.open_table("validation")
seed = (
tbl.search()
.select(["question_emb", "question", "answer"])
.limit(1)
.offset(42)
.to_list()[0]
)
hits = (
tbl.search(seed["question_emb"], vector_column_name="image_emb")
.metric("cosine")
.select(["image_id", "question", "answer", "ocr_tokens"])
.limit(10)
.to_list()
)
print("query question:", seed["question"], "->", seed["answer"])
for r in hits:
print(f" {r['image_id']:>14} {r['question'][:60]} ocr={r['ocr_tokens'][:5]}")
Because the CLIP embeddings are cosine-normalized, cosine is the right metric and the first hit will often be the source row itself. Swap vector_column_name="image_emb" for question_emb to find paraphrased questions instead of visually similar images.
Because the dataset also ships an INVERTED index on question and answer, the same query can be issued as a hybrid search that combines the dense vector with a literal keyword match. This is particularly useful for TextVQA, where a brand name or sign content like "stop" must literally appear in the question (or eventually, the answer) while CLIP handles the visual side.
hybrid_hits = (
tbl.search(query_type="hybrid", vector_column_name="image_emb")
.vector(seed["question_emb"])
.text("brand name")
.select(["image_id", "question", "answer", "ocr_tokens"])
.limit(10)
.to_list()
)
for r in hybrid_hits:
print(f" {r['image_id']:>14} {r['question'][:60]} -> {r['answer']}")
Tune metric, nprobes, and refine_factor on the vector side to trade recall against latency.
Curate
Curation passes for TextVQA usually combine an OCR-driven structural filter (does this image actually contain a meaningful amount of detected text?) with a content predicate on the question or the canonical answer, so the candidate set is both visually interesting and topically focused. Stacking both inside a single filtered scan keeps the result small and explicit, and the bounded .limit(500) makes it cheap to inspect before committing the subset to anything downstream.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/textvqa-lance/data")
tbl = db.open_table("validation")
candidates = (
tbl.search()
.where(
"array_length(ocr_tokens) >= 5 AND question LIKE '%brand%' AND length(answer) > 0",
prefilter=True,
)
.select(["question_id", "image_id", "question", "answer", "ocr_tokens"])
.limit(500)
.to_list()
)
print(f"{len(candidates)} candidates; first: {candidates[0]['question']} -> {candidates[0]['answer']}")
The result is a plain list of dictionaries, ready to inspect, persist as a manifest of question_ids, or feed into the Evolve and Train workflows below. The image column is never read, so the network traffic for a 500-row candidate scan is dominated by question, answer, and OCR-token strings rather than JPEG bytes.
Evolve
Lance stores each column independently, so a new column can be appended without rewriting the existing data. The lightest form is a SQL expression: derive the new column from columns that already exist, and Lance computes it once and persists it. The example below adds an ocr_token_count, an is_yes_no_question flag, and an answer_length integer, any of which can then be used directly in where clauses without recomputing the predicate on every query.
Note: Mutations require a local copy of the dataset, since the Hub mount is read-only. See the Materialize-a-subset section at the end of this card for a streaming pattern that downloads only the rows and columns you need, or use
hf downloadto pull the full split first.
import lancedb
db = lancedb.connect("./textvqa-lance/data") # local copy required for writes
tbl = db.open_table("validation")
tbl.add_columns({
"ocr_token_count": "array_length(ocr_tokens)",
"is_yes_no_question": "lower(answer) IN ('yes', 'no')",
"answer_length": "length(answer)",
"question_length": "length(question)",
})
If the values you want to attach already live in another table (a stronger OCR system's tokens, a model's predicted answer, an annotator-disagreement score), merge them in by joining on question_id:
import pyarrow as pa
predictions = pa.table({
"question_id": pa.array(["34602", "34603"]),
"model_answer": pa.array(["pepsi", "exit"]),
"model_confidence": pa.array([0.88, 0.72]),
})
tbl.merge(predictions, on="question_id")
The original columns and indices are untouched, so existing code that does not reference the new columns continues to work unchanged. New columns become visible to every reader as soon as the operation commits. For column values that require a Python computation (e.g., running an alternate OCR engine over the image bytes), Lance provides a batch-UDF API — see the Lance data evolution docs.
Train
Projection lets a training loop read only the columns each step actually needs. LanceDB tables expose this through Permutation.identity(tbl).select_columns([...]), which plugs straight into the standard torch.utils.data.DataLoader so prefetching, shuffling, and batching behave as in any PyTorch pipeline. For a TextVQA fine-tune that needs OCR conditioning, project the JPEG bytes, the question, the OCR tokens, and the canonical answer; columns added in the Evolve section above cost nothing per batch until they are explicitly projected.
import lancedb
from lancedb.permutation import Permutation
from torch.utils.data import DataLoader
db = lancedb.connect("hf://datasets/lance-format/textvqa-lance/data")
tbl = db.open_table("train")
train_ds = Permutation.identity(tbl).select_columns(["image", "question", "ocr_tokens", "answer"])
loader = DataLoader(train_ds, batch_size=64, shuffle=True, num_workers=4)
for batch in loader:
# batch carries only the projected columns; decode the JPEG bytes,
# tokenize the question and OCR tokens, forward through the VLM,
# compute the loss against `answer`...
...
Switching feature sets is a configuration change: passing ["image_emb", "question_emb", "answer"] to select_columns(...) on the next run skips JPEG decoding entirely and reads only the cached 512-d vectors, which is the right shape for training a lightweight reranker or a linear probe on top of frozen CLIP features.
Versioning
Every mutation to a Lance dataset, whether it adds a column, merges labels, or builds an index, commits a new version. Previous versions remain intact on disk. You can list versions and inspect the history directly from the Hub copy; creating new tags requires a local copy since tags are writes.
import lancedb
db = lancedb.connect("hf://datasets/lance-format/textvqa-lance/data")
tbl = db.open_table("validation")
print("Current version:", tbl.version)
print("History:", tbl.list_versions())
print("Tags:", tbl.tags.list())
Once you have a local copy, tag a version for reproducibility:
local_db = lancedb.connect("./textvqa-lance/data")
local_tbl = local_db.open_table("validation")
local_tbl.tags.create("openclip-vitb32-v1", local_tbl.version)
A tagged version can be opened by name, or any version reopened by its number, against either the Hub copy or a local one:
tbl_v1 = db.open_table("validation", version="openclip-vitb32-v1")
tbl_v5 = db.open_table("validation", version=5)
Pinning supports two workflows. A retrieval system locked to openclip-vitb32-v1 keeps returning stable results while the dataset evolves in parallel — newly added OCR systems or model predictions do not change what the tag resolves to. A training experiment pinned to the same tag can be rerun later against the exact same images, questions, and OCR tokens, so changes in metrics reflect model changes rather than data drift. Neither workflow needs shadow copies or external manifest tracking.
Materialize a subset
Reads from the Hub are lazy, so exploratory queries only transfer the columns and row groups they touch. Mutating operations (Evolve, tag creation) need a writable backing store, and a training loop benefits from a local copy with fast random access. Both can be served by a subset of the dataset rather than the full split. The pattern is to stream a filtered query through .to_batches() into a new local table; only the projected columns and matching row groups cross the wire, and the bytes never fully materialize in Python memory.
import lancedb
remote_db = lancedb.connect("hf://datasets/lance-format/textvqa-lance/data")
remote_tbl = remote_db.open_table("train")
batches = (
remote_tbl.search()
.where("array_length(ocr_tokens) >= 5")
.select(["question_id", "image_id", "image", "question", "answer", "ocr_tokens", "image_emb", "question_emb"])
.to_batches()
)
local_db = lancedb.connect("./textvqa-ocr-rich")
local_db.create_table("train", batches)
The resulting ./textvqa-ocr-rich is a first-class LanceDB database. Every snippet in the Evolve, Train, and Versioning sections above works against it by swapping hf://datasets/lance-format/textvqa-lance/data for ./textvqa-ocr-rich.
Source & license
Converted from lmms-lab/textvqa. TextVQA is released under CC BY 4.0 by Singh et al. (Facebook AI Research).
Citation
@inproceedings{singh2019towards,
title={Towards VQA models that can read},
author={Singh, Amanpreet and Natarajan, Vivek and Shah, Meet and Jiang, Yu and Chen, Xinlei and Batra, Dhruv and Parikh, Devi and Rohrbach, Marcus},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2019}
}
- Downloads last month
- 85