Add text embeddings description (#10)
Browse files- Add text embeddings description (ad3b59eb11c3f9ebe1cbf29a86613e2d735c92c6)
- Add link to embeddings description (84d55e8bb6baa8d278b336ebfe0a76e242fad7e3)
- README.md +1 -1
- embeddings/README.md +60 -0
README.md
CHANGED
@@ -72,7 +72,7 @@ Image Classification, Zero-shot and few-shot Classification.
|
|
72 |
source=gbif/
|
73 |
```
|
74 |
|
75 |
-
The `embeddings/` directory contains the [BioCLIP 2](https://huggingface.co/imageomics/bioclip-2) text embeddings for all 190,988,120 images with full taxonomic labels in the TreeOfLife-200M dataset.
|
76 |
|
77 |
|
78 |
To avoid republishing existing datasets or interfering with original data source providers' ability to track use of their data, we provide all metadata here with step-by-step reproduction instructions in the [GitHub repository](https://github.com/Imageomics/TreeOfLife-toolbox/tree/main/docs#treeoflife200m-dataset-download-guide) to download the images and recreate the proper webdataset structure. This process will produce a collection of files named `shard-######.tar` in a `train` folder with which to work.
|
|
|
72 |
source=gbif/
|
73 |
```
|
74 |
|
75 |
+
The `embeddings/` directory contains the [BioCLIP 2](https://huggingface.co/imageomics/bioclip-2) text embeddings for all 190,988,120 images with full taxonomic labels in the TreeOfLife-200M dataset. See [`embeddings/README.md`](embeddings/README.md) for more information.
|
76 |
|
77 |
|
78 |
To avoid republishing existing datasets or interfering with original data source providers' ability to track use of their data, we provide all metadata here with step-by-step reproduction instructions in the [GitHub repository](https://github.com/Imageomics/TreeOfLife-toolbox/tree/main/docs#treeoflife200m-dataset-download-guide) to download the images and recreate the proper webdataset structure. This process will produce a collection of files named `shard-######.tar` in a `train` folder with which to work.
|
embeddings/README.md
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Text Embeddings
|
2 |
+
|
3 |
+
[BioCLIP 2 text embeddings of TreeOfLife-200M](txt_emb_species.npy) were generated with [`make_txt_embedding.py`](https://github.com/Imageomics/TreeOfLife-toolbox/blob/main/processing/scripts/make_txt_embedding.py), using the [`txt_emb_species.json`](txt_emb_species.json) to provide the 7-rank Linnean taxonomic names.
|
4 |
+
|
5 |
+
## Taxonomic JSON Construction
|
6 |
+
|
7 |
+
The `JSON` was created from the [TreeOfLife-200M catalog](../catalog.parquet) through the following process:
|
8 |
+
* **Null Value Filtering:** Remove records where `kingdom`, `phylum`, `class`, `order`, `family`, `genus`, or `species` are `null`.
|
9 |
+
* **Deduplication:** Rows are deduplicated based on the combination of `kingdom`, `phylum`, `class`, `order`, `family`, `genus`, and `species`. This ensures that each unique taxonomic combination appears exactly once.
|
10 |
+
* **Common Name Handling:** Currently, the source metadata often contains multiple common names for a single unique taxonomic combination. During processing, **the first common name encountered** for a given unique taxonomic combination is retained. We plan future improvements to establish a definitive 1-to-1 mapping or a more comprehensive common name strategy.
|
11 |
+
|
12 |
+
### Structure
|
13 |
+
|
14 |
+
The JSON file is a single top-level array. Each element within this array is itself an array of two elements:
|
15 |
+
|
16 |
+
* **Inner Array (Index 0):** A list of strings representing the full taxonomic path from `kingdom` to `species`.
|
17 |
+
* **String (Index 1):** The common name associated with that taxonomic combination.
|
18 |
+
|
19 |
+
#### Example
|
20 |
+
|
21 |
+
```json
|
22 |
+
[
|
23 |
+
[
|
24 |
+
[
|
25 |
+
"Plantae",
|
26 |
+
"Bryophyta",
|
27 |
+
"Bryopsida",
|
28 |
+
"Bryales",
|
29 |
+
"Bryaceae",
|
30 |
+
"Bryum",
|
31 |
+
"gracile"
|
32 |
+
],
|
33 |
+
""
|
34 |
+
],
|
35 |
+
[
|
36 |
+
[
|
37 |
+
"Animalia",
|
38 |
+
"Chordata",
|
39 |
+
"Aves",
|
40 |
+
"Passeriformes",
|
41 |
+
"Mitrospingidae",
|
42 |
+
"Orthogonys",
|
43 |
+
"chloricterus"
|
44 |
+
],
|
45 |
+
"Olive-green tanager"
|
46 |
+
],
|
47 |
+
[
|
48 |
+
[
|
49 |
+
"Animalia",
|
50 |
+
"Arthropoda",
|
51 |
+
"Insecta",
|
52 |
+
"Lepidoptera",
|
53 |
+
"Lycaenidae",
|
54 |
+
"Orthomiella",
|
55 |
+
"rantaizana"
|
56 |
+
],
|
57 |
+
"Chinese Straight-wing Blue"
|
58 |
+
],
|
59 |
+
]
|
60 |
+
```
|