# 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. ## Taxonomic JSON Construction The `JSON` was created from the [TreeOfLife-200M catalog](../catalog.parquet) 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 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. ### Structure The JSON file is a single top-level array. Each element within this array is itself an array of two elements: * **Inner Array (Index 0):** A list of strings representing the full taxonomic path from `kingdom` to `species`. * **String (Index 1):** The common name associated with that taxonomic combination. #### Example ```json [ [ [ "Plantae", "Bryophyta", "Bryopsida", "Bryales", "Bryaceae", "Bryum", "gracile" ], "" ], [ [ "Animalia", "Chordata", "Aves", "Passeriformes", "Mitrospingidae", "Orthogonys", "chloricterus" ], "Olive-green tanager" ], [ [ "Animalia", "Arthropoda", "Insecta", "Lepidoptera", "Lycaenidae", "Orthomiella", "rantaizana" ], "Chinese Straight-wing Blue" ], ] ```