Datasets:
Add MIMIC dataset
Browse files
README.md
CHANGED
|
@@ -9,6 +9,11 @@ tags:
|
|
| 9 |
- multimodal
|
| 10 |
- mimic
|
| 11 |
pretty_name: LORE Examples
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# LORE Examples
|
|
@@ -25,12 +30,12 @@ model's context window.
|
|
| 25 |
|
| 26 |
## Contents
|
| 27 |
|
| 28 |
-
Two parallel views of the **same** rows:
|
| 29 |
|
| 30 |
-
|
|
| 31 |
-
|------|--------|-----|
|
| 32 |
-
| `raw/examples.jsonl` | modality name → raw value (nucleotide/AA string, per-position track, …) | `model.input([row])` — the tokenizers run for you |
|
| 33 |
-
| `tokenized/examples.jsonl` | `tok_<modality>` → token-id list | `model.input([row])` — pre-tokenized; needed for `prot_struct` / text modalities on a base install |
|
| 34 |
|
| 35 |
Every row carries `kind` (`rna` / `protein` / `both`) plus `uniprot_id` /
|
| 36 |
`genome_feature_id` anchors. The `tokenized` view covers **all** modalities
|
|
@@ -40,21 +45,26 @@ modalities that invert without the optional `[structure]` / `[text]` extras.
|
|
| 40 |
## Usage
|
| 41 |
|
| 42 |
```python
|
| 43 |
-
import
|
| 44 |
from mimic import load_pretrained
|
| 45 |
|
| 46 |
model = load_pretrained(version="1.0")
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
reps = model.embed(sep_encodings=False)
|
| 53 |
|
| 54 |
-
# tokenized view —
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
model.input([
|
| 58 |
```
|
| 59 |
|
| 60 |
## See also
|
|
|
|
| 9 |
- multimodal
|
| 10 |
- mimic
|
| 11 |
pretty_name: LORE Examples
|
| 12 |
+
configs:
|
| 13 |
+
- config_name: raw
|
| 14 |
+
data_files: raw/examples.jsonl
|
| 15 |
+
- config_name: tokenized
|
| 16 |
+
data_files: tokenized/examples.jsonl
|
| 17 |
---
|
| 18 |
|
| 19 |
# LORE Examples
|
|
|
|
| 30 |
|
| 31 |
## Contents
|
| 32 |
|
| 33 |
+
Two parallel views of the **same** rows, exposed as two dataset configs:
|
| 34 |
|
| 35 |
+
| Config | Format | Use |
|
| 36 |
+
|--------|--------|-----|
|
| 37 |
+
| `raw` (`raw/examples.jsonl`) | modality name → raw value (nucleotide/AA string, per-position track, …) | `model.input([row])` — the tokenizers run for you |
|
| 38 |
+
| `tokenized` (`tokenized/examples.jsonl`) | `tok_<modality>` → token-id list | `model.input([row])` — pre-tokenized; needed for `prot_struct` / text modalities on a base install |
|
| 39 |
|
| 40 |
Every row carries `kind` (`rna` / `protein` / `both`) plus `uniprot_id` /
|
| 41 |
`genome_feature_id` anchors. The `tokenized` view covers **all** modalities
|
|
|
|
| 45 |
## Usage
|
| 46 |
|
| 47 |
```python
|
| 48 |
+
from datasets import load_dataset
|
| 49 |
from mimic import load_pretrained
|
| 50 |
|
| 51 |
model = load_pretrained(version="1.0")
|
| 52 |
|
| 53 |
+
ANCHORS = ("kind", "uniprot_id", "genome_feature_id")
|
| 54 |
+
|
| 55 |
+
def to_sample(row):
|
| 56 |
+
# drop anchor columns and modalities absent from this row (stored as null)
|
| 57 |
+
return {k: v for k, v in row.items() if k not in ANCHORS and v is not None}
|
| 58 |
+
|
| 59 |
+
# raw view — modality name -> raw value; tokenizers run inside input()
|
| 60 |
+
raw = load_dataset("polymathic-ai/LORE-examples", "raw", split="train")
|
| 61 |
+
model.input([to_sample(raw[0])])
|
| 62 |
reps = model.embed(sep_encodings=False)
|
| 63 |
|
| 64 |
+
# tokenized view — tok_ keys with pre-tokenized ids
|
| 65 |
+
# (covers prot_struct / text modalities without the optional extras)
|
| 66 |
+
tok = load_dataset("polymathic-ai/LORE-examples", "tokenized", split="train")
|
| 67 |
+
model.input([to_sample(tok[0])])
|
| 68 |
```
|
| 69 |
|
| 70 |
## See also
|