Datasets:
Publish all indexed ptb-xl tables and dataset card
#1
by tsmithv11 - opened
This view is limited to 50 files because it contains too many changes. See the raw diff here.
Files changed (50)
- .gitattributes+20
- LICENSE.txtAdded+317
- README.mdAdded+235
- data/test.lance/_indices/62459222-2d76-4cf2-a4c0-d512ea5ced28/bitmap_page_lookup.lanceAdded
- data/test.lance/_indices/6e8638dc-f105-48c3-b3f7-81f7e3b85e61/auxiliary.idxAdded+3
- data/test.lance/_indices/6e8638dc-f105-48c3-b3f7-81f7e3b85e61/index.idxAdded
- data/test.lance/_indices/831b2275-460a-43a7-8553-6bba898e399e/page_data.lanceAdded
- data/test.lance/_indices/831b2275-460a-43a7-8553-6bba898e399e/page_lookup.lanceAdded
- data/test.lance/_indices/b6c7b2fe-5080-4b87-975d-76469c33838b/bitmap_page_lookup.lanceAdded
- data/test.lance/_refs/tags/release-v1.jsonAdded+8
- data/test.lance/_transactions/0-17db2101-15c9-49e4-8aad-7e7e72d58a61.txnAdded
- data/test.lance/_transactions/1-5187b1b4-9758-4c85-8c37-7c894bb2c097.txnAdded
- data/test.lance/_transactions/2-8f019434-47fc-490f-9a5c-667bf9aa9693.txnAdded
- data/test.lance/_transactions/3-ac7c71bf-3ddc-4881-b936-8c72b4e61f88.txnAdded
- data/test.lance/_transactions/4-cefc6929-50af-43d8-a37e-9743a78b3229.txnAdded
- data/test.lance/_versions/18446744073709551610.manifestAdded
- data/test.lance/_versions/18446744073709551611.manifestAdded
- data/test.lance/_versions/18446744073709551612.manifestAdded
- data/test.lance/_versions/18446744073709551613.manifestAdded
- data/test.lance/_versions/18446744073709551614.manifestAdded
- data/test.lance/_versions/latest_version_hint.jsonAdded+1
- data/test.lance/data/010101000000001101010100995e71479ab0f6d86a77f21310.lanceAdded+3
- data/test.lance/data/110010111000001010001100ed3a064a2db85664da55a63a12.lanceAdded+3
- data/train.lance/_indices/2933a5a6-10de-4886-aea4-57e05870fb88/auxiliary.idxAdded+3
- data/train.lance/_indices/2933a5a6-10de-4886-aea4-57e05870fb88/index.idxAdded
- data/train.lance/_indices/3984836c-0e03-41e6-89ab-37eb931fb298/page_data.lanceAdded+3
- data/train.lance/_indices/3984836c-0e03-41e6-89ab-37eb931fb298/page_lookup.lanceAdded
- data/train.lance/_indices/a3b4349b-b117-49c3-a764-6b09d877f9c1/bitmap_page_lookup.lanceAdded+3
- data/train.lance/_indices/d98e9ad0-255c-4853-90cb-000a9fa1aada/bitmap_page_lookup.lanceAdded
- data/train.lance/_refs/tags/release-v1.jsonAdded+8
- data/train.lance/_transactions/0-83e83246-81ca-498a-8fa2-cff81f2eb8be.txnAdded
- data/train.lance/_transactions/1-f9a3b41a-6adf-43fc-a84a-9d606efea0d9.txnAdded
- data/train.lance/_transactions/2-629b0756-4404-4aeb-9cef-67741088a08c.txnAdded
- data/train.lance/_transactions/3-1469e84a-52b2-469e-89cd-28b871bafbd3.txnAdded
- data/train.lance/_transactions/4-c131de5b-0345-41c2-a06e-ea8de8f2e176.txnAdded
- data/train.lance/_versions/18446744073709551610.manifestAdded
- data/train.lance/_versions/18446744073709551611.manifestAdded
- data/train.lance/_versions/18446744073709551612.manifestAdded
- data/train.lance/_versions/18446744073709551613.manifestAdded
- data/train.lance/_versions/18446744073709551614.manifestAdded
- data/train.lance/_versions/latest_version_hint.jsonAdded+1
- data/train.lance/data/00001010100100001000001063a1cb410d8c0c694e48a27c92.lanceAdded+3
- data/train.lance/data/01000001000100110010011164ffb24655bf0ae8b8175b5f61.lanceAdded+3
- data/train.lance/data/010001101101100100010101af2a004c0ab72c1fcc363494e7.lanceAdded+3
- data/train.lance/data/0110011001011110101011105e2ce14acfbbe438845a30be80.lanceAdded+3
- data/train.lance/data/0110101000011001010111005fe143400c953c96b5b739dbd8.lanceAdded+3
- data/train.lance/data/100011100100011001110110e730ba4f4291361cc75961eb18.lanceAdded+3
- data/train.lance/data/101010110001010101010110f9127b447e8bf30a5b7d589bbb.lanceAdded+3
- data/train.lance/data/10110111110001110111000074fcf24b5a8a22494daf89dc83.lanceAdded+3
- data/train.lance/data/1100100110011101001001102f74ed44f3ac488064d5eaf97a.lanceAdded+3
57 unmodified lines58596057 unmodified lines# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -text57 unmodified lines585960616263646566676869707172737475767778798057 unmodified lines# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -textdata/test.lance/_indices/6e8638dc-f105-48c3-b3f7-81f7e3b85e61/auxiliary.idx filter=lfs diff=lfs merge=lfs -textdata/test.lance/data/010101000000001101010100995e71479ab0f6d86a77f21310.lance filter=lfs diff=lfs merge=lfs -textdata/test.lance/data/110010111000001010001100ed3a064a2db85664da55a63a12.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/_indices/2933a5a6-10de-4886-aea4-57e05870fb88/auxiliary.idx filter=lfs diff=lfs merge=lfs -textdata/train.lance/_indices/3984836c-0e03-41e6-89ab-37eb931fb298/page_data.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/_indices/a3b4349b-b117-49c3-a764-6b09d877f9c1/bitmap_page_lookup.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/00001010100100001000001063a1cb410d8c0c694e48a27c92.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/01000001000100110010011164ffb24655bf0ae8b8175b5f61.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/010001101101100100010101af2a004c0ab72c1fcc363494e7.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/0110011001011110101011105e2ce14acfbbe438845a30be80.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/0110101000011001010111005fe143400c953c96b5b739dbd8.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/100011100100011001110110e730ba4f4291361cc75961eb18.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/101010110001010101010110f9127b447e8bf30a5b7d589bbb.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/10110111110001110111000074fcf24b5a8a22494daf89dc83.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/1100100110011101001001102f74ed44f3ac488064d5eaf97a.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/1111010011111010000011003379604b668635fa0b1ad2bb66.lance filter=lfs diff=lfs merge=lfs -textdata/train.lance/data/111111010110011010001100e6664d4936aa98b4b123860624.lance filter=lfs diff=lfs merge=lfs -textdata/validation.lance/_indices/fdc3a99d-06ab-4045-afac-f7ce92f6922a/auxiliary.idx filter=lfs diff=lfs merge=lfs -textdata/validation.lance/data/0011000001010101100101109ba2ae46dbab86129181ad44af.lance filter=lfs diff=lfs merge=lfs -textdata/validation.lance/data/00111001101010000111100140aecb4d3f981330d3488fa858.lance filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235---pretty_name: PTB-XL v1.0.3 in Lancelicense: cc-by-4.0language:- en- detags:- lance- ecg- waveforms- information-retrievalsize_categories:- 10K<n<100Kconfigs:- config_name: default data_files: - split: train path: "data/train.lance/**" - split: validation path: "data/validation.lance/**" - split: test path: "data/test.lance/**"---
# PTB-XL v1.0.3 in Lance
Search the full PTB-XL corpus for ECGs with particular annotated findings, then retrieve the matching 12-lead waveforms. Each result represents one 10-second ECG. Its row contains the original report, the joined SCP-ECG statements and likelihoods, and the original 100 Hz and 500 Hz WFDB records.
## Key features
- The original `ecg_id`, pseudonymous `patient_id`, recommended fold, and source paths are retained.- Each ECG has one indexed embedding of its standardized statement descriptions.- WFDB header and signal bytes are preserved as published. Fetch either sampling rate on demand.
## Splits
| Table | Publisher folds | ECGs | Patients | SCP assignments | WFDB files ||---|---|---:|---:|---:|---:|| `train` | 1–8 | 17,418 | 15,023 | 48,833 | 69,672 || `validation` | 9 | 2,183 | 1,942 | 6,084 | 8,732 || `test` | 10 | 2,198 | 1,904 | 6,090 | 8,792 || **Total** | 1–10 | **21,799** | **18,869** | **61,007** | **87,196** |
Every split uses the same schema. The original 43,598 WFDB records comprise one header and one signal file per ECG at each sampling rate. See the fold counts, index metadata, and original 71-code lookup table in [meta/info.json](meta/info.json) and [meta/scp_statements.csv](meta/scp_statements.csv).
## Schema
| Columns | Type | Contents ||---|---|---|| `ecg_id`, `patient_id`, `strat_fold`, `split` | Integers, string | Source record and patient keys, original fold and recommended split || `filename_lr`, `filename_hr` | String | Original relative WFDB stems without extensions || `report`, `recording_date`, `device` | String | Source report, shifted recording date, and recording device || `age`, `sex`, `height`, `weight`, `nurse`, `site` | Numeric | Original demographics and pseudonymous collection identifiers || `validated_by`, `validated_by_human`, `second_opinion`, `initial_autogenerated_report` | Integer, Boolean | Original review metadata || `heart_axis`, `infarction_stadium1`, `infarction_stadium2`, `baseline_drift`, `static_noise`, `burst_noise`, `electrodes_problems`, `extra_beats`, `pacemaker` | String | Original assessment and signal-quality fields || `scp_codes`, `scp_code_ids` | List of structs, list of strings | Original code and likelihood plus description and diagnostic, form, rhythm, class, and subclass fields. The ID list supports filters || `statement_text`, `statement_embedding` | String, 384 float32 values | Descriptions used for search and their embedding || `wfdb_header_100`, `wfdb_header_500` | Binary | Original `.hea` files || `wfdb_data_100`, `wfdb_data_500` | Lance blobs | Original `.dat` files |
The publisher uses pseudonymous IDs, shifted dates, and special values for ages over 89. The card’s search ranks source annotations. The vector has no waveform samples as input. [PhysioNet data description](https://physionet.org/content/ptb-xl/1.0.3/#data-description)
## Pre-built indices
Each split has a cosine `IVF_FLAT` index on `statement_embedding`, a `BTREE` index on `ecg_id`, a `BITMAP` index on `strat_fold`, and a `LABEL_LIST` index on `scp_code_ids`.
The conversion embeds source descriptions sorted by SCP code, stripped of surrounding whitespace and trailing periods, then joined with a period and a space. The encoder uses the `passage: ` prefix, the published tokenizer with truncation at 512 tokens, attention-masked mean pooling, and L2 normalization. Search uses the corresponding `query: ` prefix. [Multilingual E5 small at the pinned model revision](https://huggingface.co/intfloat/multilingual-e5-small/tree/614241f622f53c4eeff9890bdc4f31cfecc418b3)
## Why Lance?
- Random access lets you fetch waveform bytes for a handful of result IDs.- Binary waveforms, nested annotations, and fixed-size vectors live together in the same table.- The index ships with the data, so every reader can query the same vectors.- Adding a derived column leaves existing waveform columns available for reuse.- Vector search can be combined with split, fold, or code filters.- Version tags pin the schema, rows, and indices used in an experiment.
## Load with `datasets.load_dataset`
```pythonfrom datasets import load_dataset
rows = load_dataset( "lance-format/ptb-xl-lance", split="test", streaming=True, columns=["ecg_id", "scp_code_ids"],)print(next(iter(rows)))```
## Load with LanceDB
LanceDB is the embedded retrieval library built on the Lance format. The examples below open a table directly on the Hub. [LanceDB documentation](https://lancedb.com/docs)
```pythonimport lancedb
db = lancedb.connect("hf://datasets/lance-format/ptb-xl-lance/data")tbl = db.open_table("test")print(tbl.count_rows())```
## Load with Lance
```pythonimport lance
ds = lance.dataset("hf://datasets/lance-format/ptb-xl-lance/data/test.lance")print(ds.count_rows(), ds.list_indices())```
For repeated training or heavy random access, download the dataset once and open `./ptb-xl-lance/data` locally.
```bashhf download lance-format/ptb-xl-lance --repo-type dataset --local-dir ./ptb-xl-lance```
## Search
Which held-out ECGs have annotations for atrial fibrillation with premature ventricular contractions? Search the test split using the bundled index, then save and decode only the three matching 100 Hz recordings.
```bashpip install lancedb==0.41.0 sentence-transformers==6.3.0 wfdb==4.3.1```
```pythonfrom pathlib import Path
import lancedbimport wfdbfrom sentence_transformers import SentenceTransformer
encoder = SentenceTransformer( "intfloat/multilingual-e5-small", revision="614241f622f53c4eeff9890bdc4f31cfecc418b3",)query = encoder.encode( "query: atrial fibrillation with premature ventricular contractions", normalize_embeddings=True,)db = lancedb.connect("hf://datasets/lance-format/ptb-xl-lance/data")tbl = db.open_table("test")hits = ( tbl.search(query, vector_column_name="statement_embedding") .metric("cosine") .nprobes(4) .select(["ecg_id", "filename_lr", "scp_code_ids", "wfdb_header_100", "_distance"]) .with_row_id(True) .limit(3) .to_list())
output = Path("ptb-xl-matches")output.mkdir(exist_ok=True)blobs = tbl.fetch_blob_files("wfdb_data_100", [hit["_rowid"] for hit in hits])for hit, blob in zip(hits, blobs, strict=True): stem = output / Path(hit["filename_lr"]).name stem.with_suffix(".hea").write_bytes(hit["wfdb_header_100"]) stem.with_suffix(".dat").write_bytes(blob.read()) record = wfdb.rdrecord(str(stem)) print(hit["ecg_id"], hit["scp_code_ids"], record.fs, record.p_signal.shape)```
## Curate
For an exact code intersection, filter the held-out split on both source codes. This gives a small set of candidates for review.
```pythonexamples = ( tbl.search() .where("array_has_all(scp_code_ids, ['AFIB', 'PVC'])") .select(["ecg_id", "scp_codes"]) .limit(20) .to_list())print([row["ecg_id"] for row in examples])```
## Evolve
On a writable local subset, derive an annotation count from the original code list. Create `train_samples` using the final section first.
```pythonlocal = lancedb.connect("./ptb-xl-local").open_table("train_samples")local.add_columns({"scp_count": "array_length(scp_code_ids)"})```
## Train
Project just the IDs and cached statement vectors for a training or analysis loop. For waveform experiments, you can use `fetch_blob_files` to prepare decoded signal windows from the original selected records.
```pythonfrom lancedb.permutation import Permutationfrom torch.utils.data import DataLoader
local = lancedb.connect("./ptb-xl-local").open_table("train_samples")features = Permutation.identity(local).select_columns(["ecg_id", "statement_embedding"])for batch in DataLoader(features, batch_size=32): print(batch.keys()) break```
## Versioning
Record the Lance version alongside your evaluation. You can use it later to inspect how a result was produced or compare two experiments against the same rows and indices.
```pythonprint(tbl.tags.list())pinned = db.open_table("test", version=5)print(pinned.version, pinned.count_rows())```
## Materialize a subset
Stream a projected training subset into a writable local table. The local database can then serve the Evolve, Train, and Versioning examples.
```pythontraining = db.open_table("train")batches = ( training.search() .where("array_has_all(scp_code_ids, ['AFIB'])") .select(["ecg_id", "scp_code_ids", "statement_embedding"]) .to_batches())lancedb.connect("./ptb-xl-local").create_table("train_samples", batches)```
## Source, license, and changes
Patrick Wagner, Nils Strodthoff, Ralf-Dieter Bousseljot, Wojciech Samek, and Tobias Schaeffter released PTB-XL v1.0.3 through PhysioNet. PTB acquired full usage rights to the underlying recordings before releasing both the waveforms and records under CC BY 4.0. [PhysioNet source](https://doi.org/10.13026/kfzx-aw45) · [Publisher license](https://physionet.org/content/ptb-xl/view-license/1.0.3/) · [License notice](LICENSE.txt)
The waveform archive came directly from PhysioNet. Its metadata and checksums were matched to Hugging Face revision `8caff550132c41fe8cf8a9bcf9b2d0300263b725`. The Lance release embeds descriptions of the SCP statements, joins the code definitions to each ECG, groups both resolutions with their shared metadata, and represents the recommended folds as three split tables. The release preserves every original WFDB file byte for byte. The Hub reported 743,520 downloads in the preceding 30 days on November 18, 2026. [Pinned upstream snapshot](https://huggingface.co/datasets/roisincrtai/ptb-xl-1.0.3/tree/8caff550132c41fe8cf8a9bcf9b2d0300263b725)
Cite the dataset, its original Scientific Data paper, and PhysioNet when using these records. [PTB-XL paper](https://doi.org/10.1038/s41597-020-0495-6) · [PhysioNet citation](https://doi.org/10.1038/s44360-026-00096-z)123version https://git-lfs.github.com/spec/v1oid sha256:16a9709f286c6d8985e822a203735b0ebec6def1f7868663477a5396eddd5311size 338992512345678{ "branch": null, "version": 5, "createdAt": "2026-11-18T22:12:29.235335Z", "updatedAt": "2026-11-18T22:12:29.235335Z", "manifestSize": 3194, "metadata": {}}1{"version":5}123version https://git-lfs.github.com/spec/v1oid sha256:e51e5bb00b25a46bdd2b4caec5858752a1d501f440b4d2f2cb352f2eb71a244esize 87962575123version https://git-lfs.github.com/spec/v1oid sha256:d44dc0a20234ee8bc97a518333cbe14bce3457b465ac512747ea1f5a79cf24cfsize 235276362123version https://git-lfs.github.com/spec/v1oid sha256:6bd87ea0f535ba17d61617131f7d572bb116a0e585ec10f004f936225b696876size 26838526123version https://git-lfs.github.com/spec/v1oid sha256:980997ee61fcbef75435d4c145ab9b946382b994a510d9118c38d9f00d0372dfsize 110342123version https://git-lfs.github.com/spec/v1oid sha256:2def2e582f3dc2a9b33149515a466886bf5364680c7a129fc034d7f16665778asize 11734612345678{ "branch": null, "version": 5, "createdAt": "2026-11-18T22:12:26.139800Z", "updatedAt": "2026-11-18T22:12:26.139800Z", "manifestSize": 4683, "metadata": {}}1{"version":5}123version https://git-lfs.github.com/spec/v1oid sha256:2b0b5029c759e6e1d4acba0db5421bd9dc981a79dabdbb0090fdad1c1fad32ffsize 235265367123version https://git-lfs.github.com/spec/v1oid sha256:b52d34f671cfd11cbc510bbffaa9912cfc034e33d53c943afb5432bf3f4c06afsize 235266881123version https://git-lfs.github.com/spec/v1oid sha256:1c7e27c074d57b4886869177557e1dfad6ff1d62886de8001d485fc5da2408ebsize 235270197123version https://git-lfs.github.com/spec/v1oid sha256:261401d2bd5ce07fc63ee8fa5b06ada83594407efe54540ffa965d5e33c2b18asize 235272897123version https://git-lfs.github.com/spec/v1oid sha256:b90d778699dcbe7d601490fa84e4da5e5850faac9765e79e6e0a92f1c18fb3cfsize 208460071123version https://git-lfs.github.com/spec/v1oid sha256:9aeb3e6882d0e2db91077d33b5f0a3e88a5f73aa5c5b9bb436d0b7dde8fa0726size 235263511123version https://git-lfs.github.com/spec/v1oid sha256:6b9176e48c3f0bf44adf5d70302fab167447c8f14391568e9d8a3dab5438f17csize 235241588123version https://git-lfs.github.com/spec/v1oid sha256:345d7b9cae4b9995e274057731b15e3135d50ebc448890805d870b1fdeb409c2size 235268723123version https://git-lfs.github.com/spec/v1oid sha256:6f673d0e2d1d94f2e07cbbd35a183a08beb151b523f63815c037c772777b8567size 235264577.gitattributes+20
LICENSE.txtAdded+317
README.mdAdded+235
data/test.lance/_indices/62459222-2d76-4cf2-a4c0-d512ea5ced28/bitmap_page_lookup.lanceAdded
data/test.lance/_indices/6e8638dc-f105-48c3-b3f7-81f7e3b85e61/auxiliary.idxAdded+3
data/test.lance/_indices/6e8638dc-f105-48c3-b3f7-81f7e3b85e61/index.idxAdded
data/test.lance/_indices/831b2275-460a-43a7-8553-6bba898e399e/page_data.lanceAdded
data/test.lance/_indices/831b2275-460a-43a7-8553-6bba898e399e/page_lookup.lanceAdded
data/test.lance/_indices/b6c7b2fe-5080-4b87-975d-76469c33838b/bitmap_page_lookup.lanceAdded
data/test.lance/_refs/tags/release-v1.jsonAdded+8
data/test.lance/_transactions/0-17db2101-15c9-49e4-8aad-7e7e72d58a61.txnAdded
data/test.lance/_transactions/1-5187b1b4-9758-4c85-8c37-7c894bb2c097.txnAdded
data/test.lance/_transactions/2-8f019434-47fc-490f-9a5c-667bf9aa9693.txnAdded
data/test.lance/_transactions/3-ac7c71bf-3ddc-4881-b936-8c72b4e61f88.txnAdded
data/test.lance/_transactions/4-cefc6929-50af-43d8-a37e-9743a78b3229.txnAdded
data/test.lance/_versions/18446744073709551610.manifestAdded
data/test.lance/_versions/18446744073709551611.manifestAdded
data/test.lance/_versions/18446744073709551612.manifestAdded
data/test.lance/_versions/18446744073709551613.manifestAdded
data/test.lance/_versions/18446744073709551614.manifestAdded
data/test.lance/_versions/latest_version_hint.jsonAdded+1
data/test.lance/data/010101000000001101010100995e71479ab0f6d86a77f21310.lanceAdded+3
data/test.lance/data/110010111000001010001100ed3a064a2db85664da55a63a12.lanceAdded+3
data/train.lance/_indices/2933a5a6-10de-4886-aea4-57e05870fb88/auxiliary.idxAdded+3
data/train.lance/_indices/2933a5a6-10de-4886-aea4-57e05870fb88/index.idxAdded
data/train.lance/_indices/3984836c-0e03-41e6-89ab-37eb931fb298/page_data.lanceAdded+3
data/train.lance/_indices/3984836c-0e03-41e6-89ab-37eb931fb298/page_lookup.lanceAdded
data/train.lance/_indices/a3b4349b-b117-49c3-a764-6b09d877f9c1/bitmap_page_lookup.lanceAdded+3
data/train.lance/_indices/d98e9ad0-255c-4853-90cb-000a9fa1aada/bitmap_page_lookup.lanceAdded
data/train.lance/_refs/tags/release-v1.jsonAdded+8
data/train.lance/_transactions/0-83e83246-81ca-498a-8fa2-cff81f2eb8be.txnAdded
data/train.lance/_transactions/1-f9a3b41a-6adf-43fc-a84a-9d606efea0d9.txnAdded
data/train.lance/_transactions/2-629b0756-4404-4aeb-9cef-67741088a08c.txnAdded
data/train.lance/_transactions/3-1469e84a-52b2-469e-89cd-28b871bafbd3.txnAdded
data/train.lance/_transactions/4-c131de5b-0345-41c2-a06e-ea8de8f2e176.txnAdded
data/train.lance/_versions/18446744073709551610.manifestAdded
data/train.lance/_versions/18446744073709551611.manifestAdded
data/train.lance/_versions/18446744073709551612.manifestAdded
data/train.lance/_versions/18446744073709551613.manifestAdded
data/train.lance/_versions/18446744073709551614.manifestAdded
data/train.lance/_versions/latest_version_hint.jsonAdded+1
data/train.lance/data/00001010100100001000001063a1cb410d8c0c694e48a27c92.lanceAdded+3
data/train.lance/data/01000001000100110010011164ffb24655bf0ae8b8175b5f61.lanceAdded+3
data/train.lance/data/010001101101100100010101af2a004c0ab72c1fcc363494e7.lanceAdded+3
data/train.lance/data/0110011001011110101011105e2ce14acfbbe438845a30be80.lanceAdded+3
data/train.lance/data/0110101000011001010111005fe143400c953c96b5b739dbd8.lanceAdded+3
data/train.lance/data/100011100100011001110110e730ba4f4291361cc75961eb18.lanceAdded+3
data/train.lance/data/101010110001010101010110f9127b447e8bf30a5b7d589bbb.lanceAdded+3
data/train.lance/data/10110111110001110111000074fcf24b5a8a22494daf89dc83.lanceAdded+3
data/train.lance/data/1100100110011101001001102f74ed44f3ac488064d5eaf97a.lanceAdded+3