xquantize's picture
Update README.md
ea019d6 verified
|
Raw History Blame Contribute Delete
12.7 kB
metadata
license: cc-by-sa-4.0
language:
  - en
tags:
  - biology
  - ecology
  - marine
  - corals
  - taxonomy
  - embeddings
  - scleractinia
pretty_name: 'CoralText Hard Corals: Text Traits for Embedding'
size_categories:
  - 1K<n<10K
task_categories:
  - feature-extraction
  - sentence-similarity
  - text-classification
source_datasets:
  - original
annotations_creators:
  - machine-generated
  - found
language_creators:
  - found
  - machine-generated
configs:
  - config_name: default
    data_files:
      - split: train
        path: coral_scleractinia_embeddings.csv
dataset_info:
  features:
    - name: species
      dtype: string
    - name: genus
      dtype: string
    - name: family
      dtype: string
    - name: worms_aphia_id
      dtype: int64
    - name: gbif_key
      dtype: int64
    - name: quality
      dtype: string
    - name: growth_form
      dtype: string
    - name: coloniality
      dtype: string
    - name: zooxanthellate
      dtype: string
    - name: depth_lower_m
      dtype: float64
    - name: depth_upper_m
      dtype: float64
    - name: geographical_region
      dtype: string
    - name: text
      dtype: string
    - name: text_source
      dtype: string
    - name: text_richness
      dtype: int64
  splits:
    - name: train
      num_examples: 1704

CoralText Hard Corals: Text Traits for Embedding

One row per accepted scleractinian (hard / stony) coral species 1,704 species, global scope each carrying a text field built for sentence/document embedding, a set of structured ecological traits and stable identifiers that link back to the source databases. Every row is traceable and the dataset is explicit about where its text comes from and how complete that text is.

This card documents not just what the dataset contains but how it was built and what was assumed, because several of those decisions materially affect how you should use it.

TL;DR

  • 1,704 accepted hard-coral species (order Scleractinia), validated against WoRMS.
  • 1,143 (67%) have embeddable text; the remaining 561 carry taxonomy and IDs only.
  • Text comes from three sources, flagged per row (text_source): real Wikipedia prose, trait-templated sentences or none.
  • A text_richness (0–5) column lets you filter out thin text before embedding, please read the reef-bias caveat below.
  • Licensing is mixed and share-alike. Because the text column includes Wikipedia prose (CC BY-SA 4.0), the dataset as a whole is released under CC BY-SA 4.0. See Licensing.

Dataset structure

A single CSV, coral_scleractinia_embeddings.csv (~910 kB), one row per species, 15 columns.

Column dictionary

Column Type Description
species str Accepted binomial (WoRMS valid name where available). Unique; one row per species.
genus str Genus.
family str Family (GBIF backbone).
worms_aphia_id int WoRMS AphiaID, the canonical marine taxonomic key. Use this to join to other marine datasets.
gbif_key int GBIF backbone taxon key.
quality str accepted or resolved_synonym — see Taxonomic validation.
growth_form str e.g. massive, encrusting, corymbose, branching, table/plate-like. (CTD trait 183)
coloniality str colonial / solitary / both. (CTD trait 104)
zooxanthellate str zooxanthellate / azooxanthellate / both — symbiotic status. Near-complete coverage. (CTD trait 41)
depth_lower_m float A depth bound in metres. Not reliably the shallow end — see the depth note. (CTD trait 92)
depth_upper_m float The other depth bound. (CTD trait 91)
geographical_region str One of six ocean regions (Indian Ocean; Western & Central Pacific; Western Atlantic; Eastern Pacific; Eastern Atlantic; Subantarctic & Antarctic). (CTD trait 35)
text str / null The embeddable description. Null when text_source = none.
text_source str wikipedia, ctd_traits or none.
text_richness int 0–5, how much real content the text carries. Comparable across sources.

How it was built

The pipeline chains four public sources, using stable IDs as join keys at every step so nothing depends on fuzzy string matching that can't be audited.

  1. Species backbone — GBIF. All species under order Scleractinia in the GBIF Backbone Taxonomy, filtered to status = ACCEPTED. This returned 8,788 "accepted species", far more than the number of living hard corals, for a reason that matters (see the fossil assumption below).
  2. Taxonomic validation — WoRMS. Each GBIF name was matched against the World Register of Marine Species via its batch taxon-matching endpoint, keeping each record's valid_AphiaID. This ID is the dataset's canonical key: synonyms pointing to the same species share one valid_AphiaID, so collapsing on it removes duplicates that name-based deduplication would miss. Only ~29% of the 8,788 GBIF names matched WoRMS expected and the main quality filter (see fossils, below).
  3. Traits — Coral Trait Database (CTD). Structured traits were pulled per-trait from coraltraits.org. 1,126 of the 1,704 species (66%) matched CTD records on species ID.
  4. Prose — English Wikipedia via Wikidata. Article text was retrieved for 261 species, resolved through Wikidata property P225 (taxon name) an exact match to the canonical name, not a Wikipedia title search. This is deliberate (see the Wikipedia assumption below).

Assumptions and decisions

These are the judgement calls baked into the data. If any conflicts with your use case, better to know now.

Fossils: the 8,788 → 1,704 reduction is intentional. Order Scleractinia has an enormous fossil record back to the Triassic and the GBIF backbone lists many fossil-only taxa as "accepted species." WoRMS catalogues described extant marine species, so fossil taxa aren't in it and fail to match. A WoRMS match was treated as the test of "is this a real, living species we can describe," and the ~6,300 unmatched names were dropped. Spot-checks confirmed the unmatched set is dominated by fossil genera (Archeoanthophyllum, Truncoconus, Dermosmilia, etc.), not living corals. This is therefore a dataset of extant hard corals, not a paleontological one.

Cross-phylum fuzzy matches were removed with a hard taxonomic gate. WoRMS matching is fuzzy, so a coral name absent from WoRMS could return a real, "accepted", similarly-spelled species from an entirely different group e.g. the coral Cycloseris striata fuzzy-matched a cumacean crustacean (Cyclaspis striata); other coral names matched crabs, sponges, oysters and a stylasterid lace coral. Left in, these would poison the embeddings with non-coral text. Each matched record's own higher classification was checked, keeping only those whose order is Scleractinia (12 cross-phylum mismatches removed). This is why the pipeline joins on validated IDs rather than trusting the name match.

"Doubtful" taxa were labelled, not silently kept or dropped. WoRMS flags some names as taxon inquirendum, nomen dubium, etc. This release keeps only accepted and resolved_synonym records (the quality column). A further ~627 doubtful taxa were excluded rather than mixed in unmarked.

Depth labels are not reliable per row use min/max, not the column names. CTD's depth fields are named "Depth lower" and "Depth upper", but inspection showed these do not reliably correspond to shallow vs. deep on a per-row basis (some rows are ordered, some reversed). Do not read depth_lower_m/depth_upper_m as min/max. For a depth range, take min() and max() of the two columns per row which is how the templated sentences were generated.

One value per species (traits). CTD often holds multiple observations per species. Each trait was resolved to a single value, preferring CTD's own "Global estimate" record where present; otherwise the modal value for categorical traits and the median for numeric traits.

Wikipedia was resolved by exact taxon ID, never by title search. Searching Wikipedia by species name readily returns the genus page, a disambiguation page or an unrelated article. Instead, Wikidata P225 (exact taxon name) → linked article was followed, so a species either resolves to its own correct article or gets nothing. Precision over recall, by design. (One consequence: species whose only Wikidata match is a common-name article e.g. Dendrogyra cylindrus → "Pillar coral" still resolve correctly.)

Trait selection was deliberately lean. Six traits were chosen for the templated text; growth form, coloniality, zooxanthellate status, a depth range and geographical region because they are ecologically discriminative and template into readable sentences. Excluded: corallite micro-measurements (numeric minutiae that add embedding noise), redundant growth-form variants and octocoral-specific traits (CTD now includes octocorals; these species are all hexacorallian and those fields don't apply).

The most important limitation: reef bias in text richness

Read this before you embed anything.

Trait and article coverage are both biased toward shallow-water reef corals, because that's what the scientific literature and Wikipedia over-cover. Quantified:

  • Zooxanthellate (shallow reef) species average ~4.7 facts per templated sentence.
  • Azooxanthellate (deep-sea) species average ~2.0 facts often just symbiosis status and ocean region.

The consequence for embeddings: deep-sea species collapse to short, near-identical sentences and mixing them with rich Wikipedia prose can cause species to cluster by text source rather than by biology an artifact, not a signal. The text_richness column exists precisely so you can control this:

  • For clean semantic work, filter text_richness >= 4 (≈465 species with substantial content) or
  • Embed the wikipedia tier alone (261 species) for maximum prose quality, or
  • Use everything, but be aware the deep-sea cluster is partly an artifact of sparsity.

This isn't a hidden defect it's a property of the underlying data, surfaced as a column so the choice is yours.

Coverage summary

text_source Species Notes
wikipedia 261 Real article prose, ~330-word median.
ctd_traits 882 Sentence templated from structured traits.
none 561 No description available; taxonomy + IDs only.
Total with text 1,143 (67%)
Total rows 1,704

Where a species has both a Wikipedia article and CTD traits, Wikipedia wins — real prose is richer than a templated sentence.

Example usage

from datasets import load_dataset

ds = load_dataset("xquantize/coraltext-hard-corals", split="train")

# Species with substantial text, ready to embed
rich = ds.filter(lambda r: r["text_richness"] is not None and r["text_richness"] >= 4)
print(len(rich), "species with rich text")

texts = rich["text"]
# embeddings = your_model.encode(texts)  # e.g. sentence-transformers

Provenance

This dataset combines four public sources:

  • GBIF Backbone Taxonomy (gbif.org) the initial species list for order Scleractinia.
  • World Register of Marine Species / WoRMS (marinespecies.org) taxonomic validation, synonym resolution and AphiaIDs.
  • Coral Trait Database / CTD (coraltraits.org) structured ecological traits.
  • English Wikipedia, resolved via Wikidata (wikidata.org) species description prose.

Snapshot generated August 2026.

Licensing

Released under CC BY-SA 4.0.

The text column incorporates English Wikipedia prose, which is CC BY-SA 4.0 a share-alike license. That obligation propagates to any dataset that redistributes the text, so the dataset as a whole is BY-SA 4.0. If you build on it and redistribute, you must (a) attribute the sources below and (b) release your derivative under a compatible share-alike license.

Component terms:

  • English Wikipedia text — CC BY-SA 4.0.
  • Coral Trait Database — CC BY 4.0 (attribution).
  • GBIF Backbone Taxonomy — attribution; cite the specific backbone/download.
  • WoRMS — attribution per WoRMS terms of use.

Underlying sources:

  • Coral Trait Database Madin, J.S. et al. (2016). The Coral Trait Database, a curated database of trait information for coral species from the global oceans. Scientific Data 3:160017.
  • Octocoral Trait Database (now merged into CTD; explains the expanded species list) Scientific Data (2025).
  • GBIF cite the specific download DOI generated at export; otherwise cite the GBIF Backbone Taxonomy.
  • WoRMS WoRMS Editorial Board (2026). World Register of Marine Species.