Add text embeddings named for associated model (#21)
Browse files- Add text embeddings named for associated model (530ba1cc1a33f902ecb8551845383f79790c52f0)
- Clarify text embedding file associated model and catalog revision (e1f919ea10aa9151c5471d6a22bd4d28128c8738)
- Added BioCLIP 2.5 Huge Text Embedding Files (a9606cf3c1a493f878d7591e5aee6cba73de3884)
- Add clarification on filter usage (d2c5d060e6fb0e6d2ed23255604349f3ef420cfb)
Co-authored-by: Net Zhang <netzhang@users.noreply.huggingface.co>
Files changed (6)
59 unmodified lines60616259 unmodified linesdataset/metadata/eol_metadata/taxon.tab filter=lfs diff=lfs merge=lfs -textdataset/metadata/eol_metadata/media_manifest.csv filter=lfs diff=lfs merge=lfs -textembeddings/txt_emb_species.json filter=lfs diff=lfs merge=lfs -text59 unmodified lines606162636459 unmodified linesdataset/metadata/eol_metadata/taxon.tab filter=lfs diff=lfs merge=lfs -textdataset/metadata/eol_metadata/media_manifest.csv filter=lfs diff=lfs merge=lfs -textembeddings/txt_emb_species.json filter=lfs diff=lfs merge=lfs -textembeddings/txt_emb_bioclip-2.json filter=lfs diff=lfs merge=lfs -textembeddings/txt_emb_bioclip-2.5-vith14.json filter=lfs diff=lfs merge=lfs -text
12345678910111213# Text Embeddings[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. 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).## Taxonomic JSON ConstructionThe `JSON` was 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:* **Null Value Filtering:** Remove records where `kingdom` or `species` are `null`.* **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.* **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.### Structure1234567891011121314151617181920212223242526272829303132333435363738394041# Text EmbeddingsBe sure to select the proper text embedding files for the model and dataset versions:## BioCLIP 2### Files```txt_emb_bioclip-2.jsontxt_emb_bioclip-2.npytxt_emb_species.json and txt_emb_species.npy: duplicates of txt_emb_bioclip-2 files to support pybioclip backwards compatibility```### Generation[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.## BioCLIP 2.5 Huge### Files```txt_emb_bioclip-2.5-vith14.jsontxt_emb_bioclip-2.5-vith14.npy```### GenerationThe [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).## Taxonomic JSON ConstructionThe `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:* **Null Value Filtering:** Remove records where `kingdom` or `species` are `null`.* **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.* **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.* **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.### Structure
123version https://git-lfs.github.com/spec/v1oid sha256:af0cb41ffbfb31e6a2e2d5e3a402529ec8245a4268f42ce45ee4e977b7127443size 84142188123version https://git-lfs.github.com/spec/v1oid sha256:d1cc734330d17ea26e6f713b289b2138b4adc90d4f524349cd16fab42d5c3358size 3255820416123version https://git-lfs.github.com/spec/v1oid sha256:4648928b006f85d83d28e5a27074ca9363465d82e778d708b369c5eaf54b8ef5size 91586174123version https://git-lfs.github.com/spec/v1oid sha256:c72442de7b0cb7fcb55ab7ca08099d0f42fbd6769efe16ca64c1daa7a8b87db2size 2664821888.gitattributes+2
embeddings/README.md+30-2
embeddings/txt_emb_bioclip-2.5-vith14.jsonAdded+3
embeddings/txt_emb_bioclip-2.5-vith14.npyAdded+3
embeddings/txt_emb_bioclip-2.jsonAdded+3
embeddings/txt_emb_bioclip-2.npyAdded+3