Skip to main content

README

This repository contains the code for training and inferring the concept embeddings described in this study:

Rubehn, A. (2026). Inductive Learning of Concept Embeddings from Cross-Linguistic Colexification Patterns with Textual Attributes. arXiv preprint.

If you use this package in your work, please cite the work above accordingly.

Note: If you are interested in the code behind the paper by Rubehn and List (2025), please check out v1.0 of this repository.

Quickstart

This package can be installed from PyPi using:

pip install conceptembeddings

The package includes a wrapper for the pretrained model. It requires that Concepticon data are cloned on your device.

from conceptembeddings import ConceptEmbeddings
from pyconcepticon import Concepticon

concepticon = Concepticon("path/to/concepticon-data")
ce = ConceptEmbeddings(concepticon=concepticon)

# embed a concept defined in Concepticon
emb_water = ce("WATER")

# embed a concept with a custom definition
emb_orc = ce.embed_definition("A fictional, aggressive humanoid creature common in fantasy literature and games")

If you have set up a "global" instance of Concepticon with cldfbench, you can instantiate a ConceptEmbeddings object without passing a Concepticon instance:

ce = ConceptEmbeddings()  # tries to access a globally defined Concepticon instance

Study Replication

To replicate the full workflow of our study, follow these steps:

1. Install dependencies

Build the source code and install all necessary dependencies by running:

pip install -e .[eval]

If you are only interested in training the concept embeddings, it is sufficient to run:

pip install -e .

2. Clone Concepticon data

The training procedure assumes that you have a copy of the Concepticon data at the root of this repository. Clone the data first by running:

git clone --depth 1 --branch v3.4.0 https://github.com/concepticon/concepticon-data

3. Extract the graph data (optional)

The files in data/graphs were created using the scripts data/create_graph.py (colexifications from IDS) and data/create_graph_clics.py (CLICS4, CLIPS), accessing the CLLD Concepticon via its Python API pyconcepticon. Simply running the Python script will create the JSON files.

4. Train the model

Train the model by running:

python run.py --config config.yaml

Hyperparameters are set as described in the study; you can adjust them by modifying config.yaml.

5. Evaluation

eval contains all materials required for the evaluation and visualization discussed in the paper. Some scripts rely on data from NoRaRe which must be downloaded first. For this, run:

cd eval/data/norare && make

Metadata

Release files for conceptembeddings 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for conceptembeddings 2.0
File Size Uploaded
conceptembeddings-2.0.tar.gz 14.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for conceptembeddings 2.0
File Interpreter ABI Platform
conceptembeddings-2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 29.0 kB

Release files / conceptembeddings-2.0.tar.gz

Download URL conceptembeddings-2.0.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
717e42333bce3e916bc4069b7ee4b5577c8606fb635d5c1bac740904da48b8fc
BLAKE2b-256 checksum
How to use checksums
2c00a284ec366fc636561c9d22e4902c94687de92fb88919c59c7f55f8294a50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / conceptembeddings-2.0-py2.py3-none-any.whl

Download URL conceptembeddings-2.0-py2.py3-none-any.whl
Size 14.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5d3b638777604491bb871280b42de80e90f81e0a1d5954dbebebb93a35725beb
BLAKE2b-256 checksum
How to use checksums
d57a9883aa37411b8204db64062506047b79b0107be2e803cc996d69ec12942c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.1

2 release files

This release

2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page