Reference free metrics for taxonomy evaluation
Project description
Reference-Free Evaluation of Taxonomies
Reference-free (and gold-standard) metrics for evaluating taxonomies — quantify how coherent, semantically adequate, and structurally sound a taxonomy is, with or without a ground-truth reference.
The metrics implemented here are described in our paper, Reference-Free Evaluation of Taxonomies (Findings of ACL 2026) — see Citation below.
Installation
Requires Python >=3.10, <=3.11. Install from PyPI:
pip install reference_free_taxonomy_eval
Or install from source:
git clone git@github.com:wullli/reference-free-taxonomy-eval.git
cd reference-free-taxonomy-eval
pip install -r requirements.txt
pip install -e .
Optional, if you have an NVIDIA GPU and want the accelerated networkx backend used by some metrics:
pip install -r requirements.gpu.txt
The NLI-based metric (NLIVerificationMetric, see below) needs a spaCy model:
python -m spacy download en_core_web_sm
Quick start
Everything starts with a Taxonomy: a thin wrapper around a networkx.DiGraph built from (parent, child) relations plus a mapping from node ids to display names.
from taxonomy_metrics.graph.taxonomy import Taxonomy
relations = [
("food", "fruit"),
("food", "vegetable"),
("fruit", "apple"),
("fruit", "pear"),
("vegetable", "carrot"),
]
names = {n: n for n in {p for p, _ in relations} | {c for _, c in relations}}
tax = Taxonomy(relations, id_to_name=names)
print(tax.leaves()) # ['apple', 'pear', 'carrot']
print(tax.depth()) # 3
print(tax.node_ancestry("apple")) # ['apple', 'fruit', 'food']
Running the reference-free metrics
Reference-free metrics score a taxonomy without needing a gold-standard taxonomy to compare against. They live in taxonomy_metrics.evaluation.reference_free and all share the same interface: metric.calculate(taxonomy, node_subset=None).
from sentence_transformers import SentenceTransformer
from taxonomy_metrics.graph.taxonomy import Taxonomy
from taxonomy_metrics.evaluation.reference_free.robustness import ConceptSimilarityCorrelationMetric, SemanticProximityMetric
from taxonomy_metrics.evaluation.reference_free.adequacy import NLIVerificationMetric
relations = [
("food", "fruit"),
("fruit", "apple"),
("fruit", "pear"),
("fruit", "stone fruit"),
("stone fruit", "peach"),
("stone fruit", "apricot"),
("food", "spice"),
("spice", "cinnamon"),
("spice", "pepper"),
("food", "vegetable"),
("vegetable", "carrot"),
("vegetable", "broccoli"),
]
names = {n: n for n in {p for p, _ in relations} | {c for _, c in relations}}
tax = Taxonomy(relations, id_to_name=names)
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
csc = ConceptSimilarityCorrelationMetric(sentence_transformer=model)
sp = SemanticProximityMetric(sentence_transformer=model)
nli = NLIVerificationMetric() # defaults to facebook/bart-large-mnli + en_core_web_sm
print(csc.calculate(tax)) # {'ConceptSimilarityCorrelation': ...}
print(sp.calculate(tax)) # {'SemanticProximity': 0.83...}
print(nli.calculate(tax)) # {'NLIVerification-Strong': ..., 'NLIVerification-Weak': ...}
Citation
If you use this package, please cite:
Pascal Wullschleger, Majid Zarharan, Donnacha Daly, Marc Pouly, and Jennifer Foster. 2026. Reference-Free Evaluation of Taxonomies. In Findings of the Association for Computational Linguistics: ACL 2026, pages 25489–25507, San Diego, California, United States. Association for Computational Linguistics.
@inproceedings{wullschleger-etal-2026-reference,
title = "Reference-Free Evaluation of Taxonomies",
author = "Wullschleger, Pascal and
Zarharan, Majid and
Daly, Donnacha and
Pouly, Marc and
Foster, Jennifer",
editor = "Liakata, Maria and
Moreira, Viviane P. and
Zhang, Jiajun and
Jurgens, David",
booktitle = "Findings of the {A}ssociation for {C}omputational {L}inguistics: {ACL} 2026",
month = jul,
year = "2026",
address = "San Diego, California, United States",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.findings-acl.1273/",
doi = "10.18653/v1/2026.findings-acl.1273",
pages = "25489--25507",
ISBN = "979-8-89176-395-1",
}
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reference_free_taxonomy_eval-0.1.2.tar.gz.
File metadata
- Download URL: reference_free_taxonomy_eval-0.1.2.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
add5784fc8ceeb008dbf3ea3edc9d72b8df9245f2bbe339afdafdb213e6a8150
|
|
| MD5 |
297b5bfbe61c225252d3f3a773d63253
|
|
| BLAKE2b-256 |
2e618f6b43fb7d09b6667bba04355077e8df90dc29e3d6d0f50bdbe02dc0755f
|
File details
Details for the file reference_free_taxonomy_eval-0.1.2-py3-none-any.whl.
File metadata
- Download URL: reference_free_taxonomy_eval-0.1.2-py3-none-any.whl
- Upload date:
- Size: 48.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0f0fe63c1ab009641eb1ec7496c117befb3e88305f7d49bd635ae4087141611
|
|
| MD5 |
a2536f48d7c2bcc0a29c9f5d0016f10e
|
|
| BLAKE2b-256 |
1e20f0af231224c5ef0cfd79232fd8e613a65f6379767eb2f8c43b71b92b882c
|