tsmithv11 commited on
Commit
923bea7
·
1 Parent(s): 54f0f23

Serve the exact FLEURS English test example from a compact Lance table (#2)

Browse files

- Serve the exact FLEURS English test example from a compact Lance table (836b04d23a59d4f7f0d67a2f7f6e5dc6c97ee7ff)

.gitattributes CHANGED
@@ -43,3 +43,4 @@ lance/utterances.lance/data/001100101010000111101001c9d17a42cfbc54512f639b6677.l
43
  lance/utterances.lance/data/001101111111001010001111e0c2a04bfdac12177e43fd528f.lance filter=lfs diff=lfs merge=lfs -text
44
  lance/utterances.lance/data/10001010011010111000011183cdbc4083a0f7e23d65a9922b.lance filter=lfs diff=lfs merge=lfs -text
45
  lance/utterances.lance/data/111111000010001001101101367f814e638d86680b59ebb1c3.lance filter=lfs diff=lfs merge=lfs -text
 
 
43
  lance/utterances.lance/data/001101111111001010001111e0c2a04bfdac12177e43fd528f.lance filter=lfs diff=lfs merge=lfs -text
44
  lance/utterances.lance/data/10001010011010111000011183cdbc4083a0f7e23d65a9922b.lance filter=lfs diff=lfs merge=lfs -text
45
  lance/utterances.lance/data/111111000010001001101101367f814e638d86680b59ebb1c3.lance filter=lfs diff=lfs merge=lfs -text
46
+ lance/en_us_test.lance/data/0000110000011100010011018557a64851b81db35906943b29.lance filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -16921,6 +16921,7 @@ FLEURS is Google's Few-shot Learning Evaluation of Universal Representations of
16921
  | Path | Contents |
16922
  | --- | --- |
16923
  | `lance/utterances.lance` | One row per recording, with the original sentence ID, transcript variants, language and speaker labels, original WAV filename, archive path, and attribution |
 
16924
  | `lance/source-files.lance` | 1,004 original files and their checksums, exposed as range-readable Lance Blob v2 values |
16925
  | `parquet-data/` | All 389 original prepared Parquet files used by Data Studio for the same 103 configurations and 309 split combinations |
16926
 
@@ -16928,7 +16929,7 @@ Open the utterances table and filter by `lang_code` and `split` to select a lang
16928
 
16929
  ## Search transcripts and locate recordings
16930
 
16931
- This release generates normalized 256-dimensional float32 vectors from each complete `raw_transcription` using the multilingual `minishlab/potion-multilingual-128M` checkpoint at revision `73908c3438cf03b6a01bcb9611d62b23d0726f08`. Recordings of the same transcript share the same vector. The table has a cosine IVF_PQ index for larger searches. The example computes exact cosine distances within the English test split. It prints the cosine similarity, the sentence ID, and the distinct recording filename for five matches. [Pinned query encoder](https://huggingface.co/minishlab/potion-multilingual-128M/tree/73908c3438cf03b6a01bcb9611d62b23d0726f08)
16932
 
16933
  Install the dependencies with `python -m pip install "pylance==14.0.3" "model2vec==0.10.0" huggingface_hub scipy`.
16934
 
@@ -16941,7 +16942,7 @@ repo = "lance-format/fleurs-lance"
16941
  revision = HfApi(token=False).dataset_info(repo, token=False).sha
16942
  base = f"hf://datasets/{repo}"
16943
  options = {"hf_revision": revision}
16944
- utterances = lance.dataset(f"{base}/lance/utterances.lance", storage_options=options)
16945
 
16946
  model_dir = snapshot_download(
16947
  "minishlab/potion-multilingual-128M",
@@ -16954,8 +16955,6 @@ query = "Fashion styles in the west lagged for decades because communication was
16954
  vector = encoder.encode(query, max_length=None, normalize=True)
16955
  matches = utterances.to_table(
16956
  columns=["id", "lang_code", "split", "path", "raw_transcription", "text_source_url", "_distance"],
16957
- filter="lang_code = 'en_us' AND split = 'test'",
16958
- prefilter=True,
16959
  nearest={"column": "embedding", "q": vector, "k": 5, "metric": "cosine", "use_index": False},
16960
  ).to_pylist()
16961
  for hit in matches:
 
16921
  | Path | Contents |
16922
  | --- | --- |
16923
  | `lance/utterances.lance` | One row per recording, with the original sentence ID, transcript variants, language and speaker labels, original WAV filename, archive path, and attribution |
16924
+ | `lance/en_us_test.lance` | The same 647 English test rows in a small table for the exact search example |
16925
  | `lance/source-files.lance` | 1,004 original files and their checksums, exposed as range-readable Lance Blob v2 values |
16926
  | `parquet-data/` | All 389 original prepared Parquet files used by Data Studio for the same 103 configurations and 309 split combinations |
16927
 
 
16929
 
16930
  ## Search transcripts and locate recordings
16931
 
16932
+ This release generates normalized 256-dimensional float32 vectors from each complete `raw_transcription` using the multilingual `minishlab/potion-multilingual-128M` checkpoint at revision `73908c3438cf03b6a01bcb9611d62b23d0726f08`. Recordings of the same transcript share the same vector. The table has a cosine IVF_PQ index for larger searches. The example opens the small English test table and computes exact cosine distances across all 647 rows. It prints the cosine similarity, the sentence ID, and the distinct recording filename for five matches. [Pinned query encoder](https://huggingface.co/minishlab/potion-multilingual-128M/tree/73908c3438cf03b6a01bcb9611d62b23d0726f08)
16933
 
16934
  Install the dependencies with `python -m pip install "pylance==14.0.3" "model2vec==0.10.0" huggingface_hub scipy`.
16935
 
 
16942
  revision = HfApi(token=False).dataset_info(repo, token=False).sha
16943
  base = f"hf://datasets/{repo}"
16944
  options = {"hf_revision": revision}
16945
+ utterances = lance.dataset(f"{base}/lance/en_us_test.lance", storage_options=options)
16946
 
16947
  model_dir = snapshot_download(
16948
  "minishlab/potion-multilingual-128M",
 
16955
  vector = encoder.encode(query, max_length=None, normalize=True)
16956
  matches = utterances.to_table(
16957
  columns=["id", "lang_code", "split", "path", "raw_transcription", "text_source_url", "_distance"],
 
 
16958
  nearest={"column": "embedding", "q": vector, "k": 5, "metric": "cosine", "use_index": False},
16959
  ).to_pylist()
16960
  for hit in matches:
lance/en_us_test.lance/_transactions/0-476da231-18fd-4add-be49-ae9d2d871fc8.txn ADDED
Binary file (1.02 kB). View file
 
lance/en_us_test.lance/_versions/18446744073709551614.manifest ADDED
Binary file (2.11 kB). View file
 
lance/en_us_test.lance/_versions/latest_version_hint.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":1}
lance/en_us_test.lance/data/0000110000011100010011018557a64851b81db35906943b29.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d13678af8977fe93390e43ab532d851a8e64d8fd1f37f4d50278d3db04e6386f
3
+ size 857506
release-info.json CHANGED
@@ -534,5 +534,13 @@
534
  "model_revision": "73908c3438cf03b6a01bcb9611d62b23d0726f08",
535
  "dimension": 256,
536
  "metric": "cosine",
537
- "working_representation": "native utterances with archive links and original assets as Lance Blob v2"
 
 
 
 
 
 
 
 
538
  }
 
534
  "model_revision": "73908c3438cf03b6a01bcb9611d62b23d0726f08",
535
  "dimension": 256,
536
  "metric": "cosine",
537
+ "working_representation": "native utterances with archive links and original assets as Lance Blob v2",
538
+ "search_example": {
539
+ "table": "lance/en_us_test.lance",
540
+ "config": "en_us",
541
+ "split": "test",
542
+ "rows": 647,
543
+ "source_table": "lance/utterances.lance",
544
+ "metric": "exact cosine"
545
+ }
546
  }