Add text embeddings named for associated model
#21
by egrace479 - opened
.gitattributes
CHANGED
|
@@ -60,3 +60,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 60 |
dataset/metadata/eol_metadata/taxon.tab filter=lfs diff=lfs merge=lfs -text
|
| 61 |
dataset/metadata/eol_metadata/media_manifest.csv filter=lfs diff=lfs merge=lfs -text
|
| 62 |
embeddings/txt_emb_species.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 60 |
dataset/metadata/eol_metadata/taxon.tab filter=lfs diff=lfs merge=lfs -text
|
| 61 |
dataset/metadata/eol_metadata/media_manifest.csv filter=lfs diff=lfs merge=lfs -text
|
| 62 |
embeddings/txt_emb_species.json filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
embeddings/txt_emb_bioclip-2.json filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
embeddings/txt_emb_bioclip-2.5-vith14.json filter=lfs diff=lfs merge=lfs -text
|
embeddings/README.md
CHANGED
|
@@ -1,13 +1,41 @@
|
|
| 1 |
# Text Embeddings
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
## Taxonomic JSON Construction
|
| 6 |
|
| 7 |
-
The `JSON`
|
| 8 |
* **Null Value Filtering:** Remove records where `kingdom` 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 catalog metadata often contains multiple common names for a single unique taxonomic combination. During processing, **the first English common name encountered** for a given unique taxonomic combination is retained. If English is not available, the first option of any language is used. We plan future improvements to establish a definitive 1-to-1 mapping or a more comprehensive common name strategy.
|
|
|
|
| 11 |
|
| 12 |
### Structure
|
| 13 |
|
|
|
|
| 1 |
# Text Embeddings
|
| 2 |
|
| 3 |
+
Be sure to select the proper text embedding files for the model and dataset versions:
|
| 4 |
+
|
| 5 |
+
## BioCLIP 2
|
| 6 |
+
|
| 7 |
+
### Files
|
| 8 |
+
|
| 9 |
+
```
|
| 10 |
+
txt_emb_bioclip-2.json
|
| 11 |
+
txt_emb_bioclip-2.npy
|
| 12 |
+
txt_emb_species.json and txt_emb_species.npy: duplicates of txt_emb_bioclip-2 files to support pybioclip backwards compatibility
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
### Generation
|
| 16 |
+
|
| 17 |
+
[BioCLIP 2 text embeddings of TreeOfLife-200M](txt_emb_bioclip-2.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_bioclip-2.json`](txt_emb_bioclip-2.json) to provide the 7-rank Linnean taxonomic names. These text embeddings match to the BioCLIP 2 training dataset, specified by the [catalog parquet from Revision a8f38b4](https://huggingface.co/datasets/imageomics/TreeOfLife-200M/blob/a8f38b4388579862c56ae57d6f094c2ac0e92e12/dataset/catalog.parquet). Note that [`txt_emb_species.npy`](txt_emb_species.npy) and [`txt_emb_species.json`](txt_emb_species.json) are duplicates of the BioCLIP 2 files, included here to maintain [pybioclip](http://github.com/Imageomics/pybioclip) functionality for versions 2.1.x and earlier.
|
| 18 |
+
|
| 19 |
+
## BioCLIP 2.5 Huge
|
| 20 |
+
|
| 21 |
+
### Files
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
txt_emb_bioclip-2.5-vith14.json
|
| 25 |
+
txt_emb_bioclip-2.5-vith14.npy
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
### Generation
|
| 29 |
+
|
| 30 |
+
The [BioCLIP 2.5 Huge text embeddings of TreeOfLife-200M](txt_emb_bioclip-2.5-vith14.npy) were also generated with [`make_txt_embedding.py`](https://github.com/Imageomics/TreeOfLife-toolbox/blob/main/processing/scripts/make_txt_embedding.py), but using the [`txt_emb_bioclip-2.5-vith14.json`](txt_emb_bioclip-2.5-vith14.json) to provide the 7-rank Linnean taxonomic names. These text embeddings match to the BioCLIP 2.5 Huge training dataset, specified by the catalog parquet added in [commit 97e2340](https://huggingface.co/datasets/imageomics/TreeOfLife-200M/commit/97e2340877d3a2ccad78078431fa68f404ed4870).
|
| 31 |
|
| 32 |
## Taxonomic JSON Construction
|
| 33 |
|
| 34 |
+
The `JSON` files were created from the [TreeOfLife-200M catalog](../catalog.parquet) (if reproducing the process, be sure to use the correct revision for the intended model) and [`VernacularName.tsv` component of the GBIF Backbone Taxonomy](https://doi.org/10.15468/39omei) using [`make_txt_embedding_json.py`](https://github.com/Imageomics/TreeOfLife-toolbox/blob/main/processing/scripts/make_txt_embedding_json.py) through the following process:
|
| 35 |
* **Null Value Filtering:** Remove records where `kingdom` or `species` are `null`.
|
| 36 |
* **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.
|
| 37 |
* **Common Name Handling:** Currently, the catalog metadata often contains multiple common names for a single unique taxonomic combination. During processing, **the first English common name encountered** for a given unique taxonomic combination is retained. If English is not available, the first option of any language is used. We plan future improvements to establish a definitive 1-to-1 mapping or a more comprehensive common name strategy.
|
| 38 |
+
* **Corrupted Label Removal:** Records where any rank looks like a CSV-parsing leak, specifically an ISO-8601 timestamp `(^\d{4}-\d{2}-\d{2}T\d{2}:\d{2})` or the literal strings `true` / `false`, are removed. This was only necessary for the BioCLIP 2.5 Huge JSON.
|
| 39 |
|
| 40 |
### Structure
|
| 41 |
|
embeddings/txt_emb_bioclip-2.5-vith14.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af0cb41ffbfb31e6a2e2d5e3a402529ec8245a4268f42ce45ee4e977b7127443
|
| 3 |
+
size 84142188
|
embeddings/txt_emb_bioclip-2.5-vith14.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1cc734330d17ea26e6f713b289b2138b4adc90d4f524349cd16fab42d5c3358
|
| 3 |
+
size 3255820416
|
embeddings/txt_emb_bioclip-2.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4648928b006f85d83d28e5a27074ca9363465d82e778d708b369c5eaf54b8ef5
|
| 3 |
+
size 91586174
|
embeddings/txt_emb_bioclip-2.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c72442de7b0cb7fcb55ab7ca08099d0f42fbd6769efe16ca64c1daa7a8b87db2
|
| 3 |
+
size 2664821888
|