Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
id
stringlengths
11
16
audio
audioduration (s)
1.41
17.3
sampling_rate
int32
16k
16k
text
stringlengths
9
338
speaker_id
int64
19
8.98k
chapter_id
int64
198
305k
num_chars
int32
9
338
text_emb
list
374-180298-0000
16,000
CHAPTER SIXTEEN I MIGHT HAVE TOLD YOU OF THE BEGINNING OF THIS LIAISON IN A FEW LINES BUT I WANTED YOU TO SEE EVERY STEP BY WHICH WE CAME I TO AGREE TO WHATEVER MARGUERITE WISHED
374
180,298
178
[ -0.048140473663806915, 0.06307218968868256, 0.062340378761291504, -0.06440156698226929, -0.03000018000602722, 0.07514388859272003, 0.045886170119047165, 0.03031815215945244, -0.003820801619440317, -0.02595929056406021, 0.03733421489596367, 0.036154549568891525, 0.001818434800952673, -0.004...
374-180298-0001
16,000
MARGUERITE TO BE UNABLE TO LIVE APART FROM ME IT WAS THE DAY AFTER THE EVENING WHEN SHE CAME TO SEE ME THAT I SENT HER MANON LESCAUT FROM THAT TIME SEEING THAT I COULD NOT CHANGE MY MISTRESS'S LIFE I CHANGED MY OWN
374
180,298
214
[ -0.04151729866862297, 0.0612168051302433, 0.04648863524198532, 0.030974265187978745, 0.034364961087703705, 0.04321794584393501, 0.04576512426137924, 0.00975677091628313, 0.019809875637292862, -0.02182554267346859, 0.017943909391760826, -0.026754114776849747, -0.006294717080891132, -0.09092...
374-180298-0002
16,000
I WISHED ABOVE ALL NOT TO LEAVE MYSELF TIME TO THINK OVER THE POSITION I HAD ACCEPTED FOR IN SPITE OF MYSELF IT WAS A GREAT DISTRESS TO ME THUS MY LIFE GENERALLY SO CALM
374
180,298
169
[ 0.0044161598198115826, 0.08109832555055618, 0.06982310861349106, -0.02666333131492138, 0.10914763808250427, -0.05801629647612572, 0.09131397306919098, 0.013409361243247986, 0.07383642345666885, -0.09690531343221664, 0.014564448036253452, -0.003383232280611992, 0.020413607358932495, -0.0603...
374-180298-0003
16,000
ASSUMED ALL AT ONCE AN APPEARANCE OF NOISE AND DISORDER NEVER BELIEVE HOWEVER DISINTERESTED THE LOVE OF A KEPT WOMAN MAY BE THAT IT WILL COST ONE NOTHING
374
180,298
153
[ -0.02014809288084507, 0.00032204989111050963, 0.058382537215948105, 0.08634647727012634, 0.019726935774087906, 0.005266185849905014, 0.07030873745679855, -0.033751823008060455, 0.1264931708574295, 0.022371813654899597, -0.011010237038135529, -0.06667336821556091, 0.03741733729839325, -0.03...
374-180298-0004
16,000
NOTHING IS SO EXPENSIVE AS THEIR CAPRICES FLOWERS BOXES AT THE THEATRE SUPPERS DAYS IN THE COUNTRY WHICH ONE CAN NEVER REFUSE TO ONE'S MISTRESS AS I HAVE TOLD YOU I HAD LITTLE MONEY
374
180,298
181
[ 0.047844838351011276, 0.06430454552173615, 0.011007397435605526, 0.05931047722697258, -0.06886113435029984, 0.009375319816172123, 0.0468275249004364, -0.08115357905626297, 0.026645032688975334, 0.01935054175555706, -0.011795414611697197, -0.0618089884519577, -0.001521263737231493, -0.03836...
374-180298-0005
16,000
MY FATHER WAS AND STILL IS RECEVEUR GENERAL AT C HE HAS A GREAT REPUTATION THERE FOR LOYALTY THANKS TO WHICH HE WAS ABLE TO FIND THE SECURITY WHICH HE NEEDED IN ORDER TO ATTAIN THIS POSITION
374
180,298
190
[ -0.003972756676375866, -0.03523051366209984, -0.01288676355034113, -0.06156430020928383, -0.08033283799886703, 0.05642407387495041, 0.060179777443408966, -0.0014525576261803508, -0.11783407628536224, 0.0005649091908708215, 0.00779699208214879, 0.04746987298130989, 0.0875639021396637, -0.01...
374-180298-0006
16,000
I CAME TO PARIS STUDIED LAW WAS CALLED TO THE BAR AND LIKE MANY OTHER YOUNG MEN PUT MY DIPLOMA IN MY POCKET AND LET MYSELF DRIFT AS ONE SO EASILY DOES IN PARIS
374
180,298
159
[ 0.033801548182964325, 0.07979462295770645, 0.02409057505428791, -0.05047499015927315, 0.08114475756883621, -0.008392896503210068, 0.019877785816788673, -0.015894340351223946, 0.0008010845049284399, 0.04119641333818436, 0.0711330771446228, 0.05480267480015755, -0.022730065509676933, -0.0444...
374-180298-0007
16,000
MY EXPENSES WERE VERY MODERATE ONLY I USED UP MY YEAR'S INCOME IN EIGHT MONTHS AND SPENT THE FOUR SUMMER MONTHS WITH MY FATHER WHICH PRACTICALLY GAVE ME TWELVE THOUSAND FRANCS A YEAR AND IN ADDITION THE REPUTATION OF A GOOD SON
374
180,298
227
[ 0.043833885341882706, 0.05535231530666351, -0.055864110589027405, 0.035264965146780014, 0.045256130397319794, -0.030365673825144768, 0.030619822442531586, 0.03235434368252754, -0.06870222836732864, -0.017154568806290627, 0.09623955935239792, -0.07913129031658173, 0.053287673741579056, 0.02...
374-180298-0008
16,000
FOR THE REST NOT A PENNY OF DEBT THIS THEN WAS MY POSITION WHEN I MADE THE ACQUAINTANCE OF MARGUERITE YOU CAN WELL UNDERSTAND THAT IN SPITE OF MYSELF MY EXPENSES SOON INCREASED
374
180,298
176
[ -0.01770230568945408, 0.05431608483195305, 0.0326986126601696, -0.025829434394836426, 0.012652638368308544, -0.004954235162585974, 0.09466293454170227, 0.033393412828445435, -0.007183740381151438, 0.0016582866664975882, 0.019425563514232635, -0.03329330310225487, -0.009295185096561909, -0....
374-180298-0009
16,000
MARGUERITE'S NATURE WAS VERY CAPRICIOUS AND LIKE SO MANY WOMEN SHE NEVER REGARDED AS A SERIOUS EXPENSE THOSE THOUSAND AND ONE DISTRACTIONS WHICH MADE UP HER LIFE SO WISHING TO SPEND AS MUCH TIME WITH ME AS POSSIBLE
374
180,298
214
[ 0.018987642601132393, 0.09983528405427933, 0.049331046640872955, 0.053845398128032684, 0.04017949849367142, 0.07874716818332672, 0.06540273129940033, 0.016682041808962822, -0.05539340525865555, 0.003584756050258875, -0.031969908624887466, -0.032194338738918304, -0.029266566038131714, -0.07...
374-180298-0010
16,000
SHE WOULD WRITE TO ME IN THE MORNING THAT SHE WOULD DINE WITH ME NOT AT HOME BUT AT SOME RESTAURANT IN PARIS OR IN THE COUNTRY I WOULD CALL FOR HER AND WE WOULD DINE AND GO ON TO THE THEATRE OFTEN HAVING SUPPER AS WELL
374
180,298
218
[ -0.02318922057747841, 0.004181867931038141, 0.11679419875144958, -0.010954919271171093, -0.04702918231487274, -0.008843942545354366, 0.03360350802540779, -0.05441994592547417, 0.07914549857378006, -0.07852984219789505, -0.028557192534208298, -0.07673578709363937, -0.017006849870085716, -0....
374-180298-0011
16,000
FORGIVE ME IF I GIVE YOU ALL THESE DETAILS BUT YOU WILL SEE THAT THEY WERE THE CAUSE OF WHAT WAS TO FOLLOW WHAT I TELL YOU IS A TRUE AND SIMPLE STORY AND I LEAVE TO IT ALL THE NAIVETE OF ITS DETAILS
374
180,298
198
[ 0.003381242509931326, 0.11017177253961563, 0.08627570420503616, 0.08382938802242279, 0.11796409636735916, -0.03202616050839424, -0.004949516616761684, -0.018320003524422646, -0.008870739489793777, 0.01883186399936676, 0.020398596301674843, 0.05842912197113037, 0.04478197544813156, -0.05362...
374-180298-0012
16,000
AND ALL THE SIMPLICITY OF ITS DEVELOPMENTS I REALIZED THEN THAT AS NOTHING IN THE WORLD WOULD MAKE ME FORGET MY MISTRESS IT WAS NEEDFUL FOR ME TO FIND SOME WAY OF MEETING THE EXPENSES INTO WHICH SHE DREW ME THEN TOO
374
180,298
215
[ -0.012332657352089882, 0.10810794681310654, 0.029971910640597343, 0.09087245911359787, 0.029512284323573112, -0.015179865062236786, 0.024199228733778, 0.01638558693230152, 0.050167180597782135, 0.024126553907990456, -0.02483518421649933, 0.023988747969269753, -0.021142609417438507, -0.0031...
374-180298-0013
16,000
MY LOVE FOR HER HAD SO DISTURBING AN INFLUENCE UPON ME THAT EVERY MOMENT I SPENT AWAY FROM MARGUERITE WAS LIKE A YEAR AND THAT I FELT THE NEED OF CONSUMING THESE MOMENTS IN THE FIRE OF SOME SORT OF PASSION
374
180,298
205
[ -0.009865010157227516, 0.039877794682979584, 0.1203124076128006, 0.0202968567609787, 0.04671715572476387, 0.07095493376255035, 0.07256204634904861, 0.018839120864868164, 0.06807047873735428, -0.06144034489989281, -0.01922759599983692, 0.012132259085774422, -0.0001797946752049029, -0.020571...
374-180298-0014
16,000
AS NOT TO KNOW THAT I WAS LIVING THEM I BEGAN BY BORROWING FIVE OR SIX THOUSAND FRANCS ON MY LITTLE CAPITAL AND WITH THIS I TOOK TO GAMBLING SINCE GAMBLING HOUSES WERE DESTROYED GAMBLING GOES ON EVERYWHERE
374
180,298
205
[ 0.10237736999988556, 0.042522575706243515, -0.046440914273262024, 0.020744575187563896, 0.022291475906968117, -0.015232697129249573, 0.0602085217833519, -0.00885506346821785, -0.006153110880404711, -0.019262872636318207, 0.07403816282749176, -0.056897785514593124, 0.02376926876604557, -0.0...
374-180298-0015
16,000
FORMERLY WHEN ONE WENT TO FRASCATI ONE HAD THE CHANCE OF MAKING A FORTUNE ONE PLAYED AGAINST MONEY AND IF ONE LOST THERE WAS ALWAYS THE CONSOLATION OF SAYING THAT ONE MIGHT HAVE GAINED WHEREAS NOW EXCEPT IN THE CLUBS
374
180,298
216
[ 0.022203661501407623, 0.014929153025150299, -0.021773504093289375, 0.03620767220854759, 0.04085107147693634, -0.00211722613312304, 0.05313193425536156, 0.08703950047492981, 0.032020147889852524, -0.0019985828548669815, -0.026926038786768913, -0.0066688633523881435, 0.007514847442507744, -0...
374-180298-0016
16,000
WHERE THERE IS STILL A CERTAIN RIGOUR IN REGARD TO PAYMENTS ONE IS ALMOST CERTAIN THE MOMENT ONE GAINS A CONSIDERABLE SUM NOT TO RECEIVE IT YOU WILL READILY UNDERSTAND WHY GAMBLING IS ONLY LIKELY TO BE CARRIED ON BY YOUNG PEOPLE
374
180,298
228
[ 0.03346576914191246, 0.06755068898200989, -0.06372217833995819, -0.028509382158517838, 0.006104853469878435, 0.04492843523621559, 0.10928628593683243, -0.016994556412100792, 0.06543778628110886, 0.03776472806930542, 0.06899762153625488, 0.028736891224980354, -0.025121768936514854, -0.00856...
374-180298-0017
16,000
VERY MUCH IN NEED OF MONEY AND NOT POSSESSING THE FORTUNE NECESSARY FOR SUPPORTING THE LIFE THEY LEAD THEY GAMBLE THEN AND WITH THIS RESULT OR ELSE THEY GAIN AND THEN THOSE WHO LOSE SERVE TO PAY FOR THEIR HORSES AND MISTRESSES
374
180,298
226
[ 0.028714319691061974, 0.04612404853105545, -0.03358662873506546, 0.01518438570201397, -0.04934190213680267, 0.002154900459572673, 0.09206272661685944, -0.04270148277282715, -0.015181241557002068, 0.03471333906054497, 0.050209805369377136, -0.019006725400686264, 0.014279729686677456, -0.059...
374-180298-0018
16,000
WHICH IS VERY DISAGREEABLE DEBTS ARE CONTRACTED ACQUAINTANCES BEGUN ABOUT A GREEN TABLE END BY QUARRELS IN WHICH LIFE OR HONOUR COMES TO GRIEF AND THOUGH ONE MAY BE AN HONEST MAN ONE FINDS ONESELF RUINED BY VERY HONEST MEN
374
180,298
222
[ -0.03429491072893143, 0.05646572634577751, -0.04781884700059891, -0.018240585923194885, -0.06306229531764984, -0.013759136199951172, 0.09684063494205475, -0.029666995629668236, 0.08039138466119766, 0.03206031769514084, 0.019719017669558525, -0.019911644980311394, -0.001522813574410975, 0.0...
374-180298-0019
16,000
WHOSE ONLY DEFECT IS THAT THEY HAVE NOT TWO HUNDRED THOUSAND FRANCS A YEAR I NEED NOT TELL YOU OF THOSE WHO CHEAT AT PLAY
374
180,298
121
[ 0.003161556785926223, 0.036269497126340866, -0.003401070600375533, -0.014681868255138397, 0.0009272702736780047, 0.017239846289157867, 0.036960721015930176, 0.07075410336256027, 0.01338008139282465, 0.031143637374043465, 0.024031968787312508, -0.08899754285812378, 0.009649518877267838, -0....
374-180298-0020
16,000
I FLUNG MYSELF INTO THIS RAPID NOISY AND VOLCANIC LIFE WHICH HAD FORMERLY TERRIFIED ME WHEN I THOUGHT OF IT AND WHICH HAD BECOME FOR ME THE NECESSARY COMPLEMENT OF MY LOVE FOR MARGUERITE WHAT ELSE COULD I HAVE DONE
374
180,298
214
[ 0.05042587220668793, 0.052868880331516266, 0.13844355940818787, 0.05458196625113487, 0.034743115305900574, -0.04305591061711311, 0.04554232209920883, 0.005878645461052656, 0.01464090682566166, -0.08846989274024963, -0.027072718366980553, -0.07685098052024841, 0.04067329689860344, -0.015579...
374-180298-0021
16,000
THE NIGHTS THAT I DID NOT SPEND IN THE RUE D'ANTIN IF I HAD SPENT THEM ALONE IN MY OWN ROOM I COULD NOT HAVE SLEPT JEALOUSY WOULD HAVE KEPT ME AWAKE AND INFLAMED MY BLOOD AND MY THOUGHTS
374
180,298
186
[ -0.04244924336671829, 0.06373271346092224, -0.017279986292123795, 0.0711589977145195, 0.09103883802890778, -0.02247972972691059, 0.05898037180304527, 0.03826093673706055, 0.080462746322155, -0.01854742504656315, 0.03685922920703888, 0.03498019650578499, 0.073892742395401, -0.04655027389526...
374-180298-0022
16,000
WHILE GAMBLING GAVE A NEW TURN TO THE FEVER WHICH WOULD OTHERWISE HAVE PREYED UPON MY HEART AND FIXED IT UPON A PASSION WHICH LAID HOLD ON ME IN SPITE OF MYSELF UNTIL THE HOUR STRUCK WHEN I MIGHT GO TO MY MISTRESS THEN
374
180,298
218
[ -0.03373359143733978, 0.09493588656187057, 0.02947887033224106, 0.06771739572286606, 0.050181981176137924, 0.027706654742360115, 0.07345406711101532, -0.013005818240344524, 0.061083436012268066, -0.01645854488015175, -0.0065939356572926044, 0.017839182168245316, 0.005168726667761803, -0.00...
End of preview. Expand in Data Studio

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

LibriSpeech clean (Lance Format)

A Lance-formatted version of the LibriSpeech ASR clean configuration, sourced from openslr/librispeech_asr. Each row is one utterance with inline FLAC audio bytes, the reference transcript, a sentence-transformers embedding of that transcript, and speaker/chapter metadata — all available directly from the Hub at hf://datasets/lance-format/librispeech-clean-lance/data.

Key features

  • Inline FLAC bytes in the audio column at 16 kHz mono, with no re-encoding from the upstream parquet.
  • Sentence-transformers embedding of the transcript in text_emb (all-MiniLM-L6-v2, 384-dim, cosine-normalized) with a bundled IVF_PQ index for semantic transcript search.
  • Pre-built INVERTED FTS index on text and BTREE indices on id, speaker_id, and chapter_id for keyword search and stable lookup by identifier.
  • Per-utterance metadataspeaker_id, chapter_id, num_chars, sampling_rate — that downstream filters can stack on.

Splits

Split Source config Rows Description
dev_clean.lance dev.clean 2,703 Standard ASR validation set
test_clean.lance test.clean 2,620 Standard ASR test set
train_clean_100.lance train.clean.100 28,539 100-hour clean training subset

The 360-hour and 500-hour LibriSpeech subsets (train.360, train.other.500) are not bundled here. To extend, point librispeech/dataprep.py at additional splits.

Schema

Column Type Notes
id string Utterance id (e.g. 1272-128104-0000)
audio large_binary Inline FLAC bytes (16 kHz mono)
sampling_rate int32 Always 16,000
text string Reference transcript
speaker_id int64 LibriVox speaker id
chapter_id int64 LibriVox chapter id
num_chars int32 Length of text in characters
text_emb fixed_size_list<float32, 384> sentence-transformers all-MiniLM-L6-v2 (cosine-normalized)

Pre-built indices

  • IVF_PQ on text_emb — semantic transcript search (cosine)
  • INVERTED (FTS) on text — keyword and hybrid search
  • BTREE on id, speaker_id, chapter_id — fast lookup by identifier

Why Lance?

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Versatile Querying: Supports combining vector similarity search, full-text search, and SQL-style filtering in a single query, accelerated by on-disk indexes.
  6. 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/librispeech-clean-lance", split="test_clean", streaming=True)
for row in hf_ds.take(3):
    print(row["id"], row["text"][:80])

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. Each .lance file in data/ is a table — open by name (dev_clean, test_clean, train_clean_100). The same handle is used by the Search, Curate, Evolve, Versioning, and Materialize-a-subset sections below.

import lancedb

db = lancedb.connect("hf://datasets/lance-format/librispeech-clean-lance/data")
tbl = db.open_table("train_clean_100")
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, the list of pre-built indices.

import lance

ds = lance.dataset("hf://datasets/lance-format/librispeech-clean-lance/data/train_clean_100.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, ANN search, and audio decoding are far faster against a local copy:

hf download lance-format/librispeech-clean-lance --repo-type dataset --local-dir ./librispeech-clean

Then point Lance or LanceDB at ./librispeech-clean/data.

Search

The bundled IVF_PQ index on text_emb makes semantic transcript retrieval a single call. In production you would encode a query string through the same sentence-transformers model used at ingest (all-MiniLM-L6-v2, cosine-normalized), then pass the resulting 384-d vector to tbl.search(...). The example below uses the embedding from row 42 as a runnable stand-in.

import lancedb

db = lancedb.connect("hf://datasets/lance-format/librispeech-clean-lance/data")
tbl = db.open_table("train_clean_100")

seed = (
    tbl.search()
    .select(["text_emb", "text"])
    .limit(1)
    .offset(42)
    .to_list()[0]
)

hits = (
    tbl.search(seed["text_emb"], vector_column_name="text_emb")
    .metric("cosine")
    .select(["id", "speaker_id", "text"])
    .limit(10)
    .to_list()
)
print("query transcript:", seed["text"][:80])
for r in hits:
    print(f"  {r['id']}  spk={r['speaker_id']}  {r['text'][:80]}")

The audio blob is never touched. A top-10 semantic search moves a few kilobytes of transcript text rather than the FLAC bytes for every candidate.

Because the dataset also ships an INVERTED index on text, the same query can be issued as a hybrid search that combines the dense vector with a keyword query — useful when a name or domain term must literally appear in the transcript but you still want the semantic side to rank the rest.

hybrid_hits = (
    tbl.search(query_type="hybrid", vector_column_name="text_emb")
    .vector(seed["text_emb"])
    .text("astronomy")
    .select(["id", "speaker_id", "text"])
    .limit(10)
    .to_list()
)
for r in hybrid_hits:
    print(f"  {r['id']}  spk={r['speaker_id']}  {r['text'][:80]}")

Tune metric, nprobes, and refine_factor on the vector side to trade recall against latency.

Curate

Building a focused subset of utterances usually means combining content with structure — pick utterances by a single speaker, or above a minimum transcript length, or matching a topic. Stacking predicates inside a single filtered scan keeps the result small and explicit, and the bounded .limit(500) makes it cheap to inspect.

import lancedb

db = lancedb.connect("hf://datasets/lance-format/librispeech-clean-lance/data")
tbl = db.open_table("train_clean_100")

candidates = (
    tbl.search()
    .where("speaker_id = 1272 AND num_chars >= 60", prefilter=True)
    .select(["id", "chapter_id", "num_chars", "text"])
    .limit(500)
    .with_row_id(True)
    .to_list()
)
print(f"{len(candidates)} utterances; first: {candidates[0]['text'][:80]}")

The scan never reads the audio column. Lance stores binary columns independently, so a metadata-only curation pass moves only the transcript text and scalar fields across the wire — even though the underlying table includes hours of inline FLAC audio.

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 a is_long_utterance flag and a coarse length_bucket, either of which can then be used directly in where clauses without re-evaluating 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.

import lancedb

db = lancedb.connect("./librispeech-clean/data")  # local copy required for writes
tbl = db.open_table("train_clean_100")

tbl.add_columns({
    "is_long_utterance": "num_chars >= 200",
    "length_bucket": (
        "CASE WHEN num_chars < 80 THEN 'short' "
        "WHEN num_chars < 200 THEN 'medium' ELSE 'long' END"
    ),
})

If the values you want to attach already live in another table (alternate transcripts, speaker embeddings, model predictions), merge them in by joining on id:

import pyarrow as pa

predictions = pa.table({
    "id": pa.array(["1272-128104-0000", "1272-128104-0001"]),
    "wer": pa.array([0.04, 0.12]),
})
tbl.merge(predictions, on="id")

The original columns and indices are untouched, so existing code that does not reference the new columns continues to work unchanged. For column values that require a Python computation (e.g., running a speaker embedding model over the FLAC bytes), Lance provides a batch-UDF API — see the Lance data evolution docs.

Train

A common pattern for audio training is to pre-extract decoded features once into a derived LanceDB table — one row per training-ready window of log-mel frames or raw PCM samples — and train against that table with the regular projection-based dataloader. take_blobs is the mechanism that makes the extraction step tractable: each utterance's FLAC bytes are randomly addressable, so the pass can subset audio on demand and write decoded windows into a fresh table without an external file store. Other workflows project audio directly through select_columns(...) and decode at the batch boundary, or skip audio entirely and train on the cached transcript embeddings — the right shape is workload-specific. The actual training loop is the same Permutation.identity(tbl).select_columns(...) snippet in every case; only the source table and the column list change.

Against a pre-extracted features table:

import lancedb
from lancedb.permutation import Permutation
from torch.utils.data import DataLoader

db = lancedb.connect("./librispeech-features")   # local table produced by the one-time extraction
tbl = db.open_table("train")

train_ds = Permutation.identity(tbl).select_columns(["log_mel", "text", "speaker_id"])
loader = DataLoader(train_ds, batch_size=32, shuffle=True, num_workers=4)

Against the cached transcript embeddings on the source table (no audio decode):

import lancedb
from lancedb.permutation import Permutation
from torch.utils.data import DataLoader

src_db = lancedb.connect("hf://datasets/lance-format/librispeech-clean-lance/data")
src_tbl = src_db.open_table("train_clean_100")

train_ds = Permutation.identity(src_tbl).select_columns(["text_emb", "speaker_id"])
loader = DataLoader(train_ds, batch_size=256, shuffle=True, num_workers=4)

The inline audio storage and take_blobs still earn their place around the training process — listening back to an utterance in a notebook, sampling for human review, one-off evaluation against a held-out set, and the pre-extraction pass itself. Each of those reads a small, explicit set of blobs once. What the Train section above keeps off the per-batch hot path is exactly that raw-audio decode: paying it every step is what the pre-extracted features are designed to avoid.

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/librispeech-clean-lance/data")
tbl = db.open_table("train_clean_100")

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("./librispeech-clean/data")
local_tbl = local_db.open_table("train_clean_100")
local_tbl.tags.create("minilm-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("train_clean_100", version="minilm-v1")
tbl_v5 = db.open_table("train_clean_100", version=5)

Pinning supports two workflows. A retrieval system locked to minilm-v1 keeps returning stable results while the dataset evolves in parallel. A training experiment pinned to the same tag can be rerun later against the exact same utterances, so changes in metrics reflect model changes rather than data drift.

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 pipeline benefits from a local copy with fast random access to the FLAC bytes. 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 — including the audio column, which streams through Arrow record batches rather than being assembled in a single buffer.

import lancedb

remote_db = lancedb.connect("hf://datasets/lance-format/librispeech-clean-lance/data")
remote_tbl = remote_db.open_table("train_clean_100")

batches = (
    remote_tbl.search()
    .where("speaker_id = 1272")
    .select(["id", "audio", "sampling_rate", "text", "speaker_id", "chapter_id", "text_emb"])
    .to_batches()
)

local_db = lancedb.connect("./librispeech-speaker-1272")
local_db.create_table("train", batches)

The resulting ./librispeech-speaker-1272 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/librispeech-clean-lance/data for ./librispeech-speaker-1272.

Source & license

Converted from openslr/librispeech_asr. LibriSpeech is released under CC BY 4.0 and is built from the public-domain LibriVox audiobook corpus.

Citation

@inproceedings{panayotov2015librispeech,
  title={LibriSpeech: An ASR corpus based on public domain audiobooks},
  author={Panayotov, Vassil and Chen, Guoguo and Povey, Daniel and Khudanpur, Sanjeev},
  booktitle={IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP)},
  year={2015}
}
Downloads last month
75