Embedding Database
This package provides a database schema and Python wrapper for storing the embeddings generated through various representation learning packages.
Currently, this package focuses on using a SQL database with SQLAlchemy, but might be extended to use a NoSQL database as an alternative.
Installation
Install embeddingdb directly from GitHub with:
$ pip install git+https://github.com/cthoyt/embeddingdb
Set the environment variable EMBEDDINGDB_CONNECTION to a valid SQLAlchemy connection string for a PostgreSQL instance, as this package uses the PostgreSQL-specific ARRAY type.
Command Line Interface
This package installs an entrypoint embeddingdb that can be used directly from the shell.
Uploading Entity Embeddings
Entities can be embedded and stored from various types of representation learning, including network representation learning, knowledge graph embedding, and textual learning.
Upload embeddings generated by word2vec by specifying the file path with:
$ embeddingdb upload --fmt word2vec --path ~/path/to/file.txt
Upload embeddings generated by pykeen by specifying the output directory with:
$ embeddingdb upload --fmt keen --path ~/path/to/directory/
Listing Entity Embeddings
After uploading, the collections can be listed with:
$ embeddingdb ls
Analyzing Entity Embeddings’ Correlations
One of the motivations for building this repository was to make a convenient way to compare the embeddings for entities generated through orthogonal embedding tecnhiques. For example, we wanted to know to what extent the embeddings for proteins generated from their sequences with ratvec contained the same information as the embeddings generated from protein-protein interaction networks with pykeen or nrl.
The two positional arguments correspond to the collection identifiers in the database.
$ embeddingdb analyze 1 2
Running with Docker
After installing Docker, the entire web application can be instantiated with:
$ docker-compose up
Get the endpoint /test to instantiate the database and add a test collection.
Metadata
Release files for embeddingdb 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| embeddingdb-0.0.1.tar.gz | 11.3 kB | Without provenance | Details for embeddingdb-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| embeddingdb-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for embeddingdb-0.0.1-py3-none-any.whl |
Total release size: 25.3 kB
Release files / embeddingdb-0.0.1.tar.gz
| Download URL | embeddingdb-0.0.1.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56bfa60b2b7907b3db5646c79f37719cff99be92f5f2bbc8c49834c97af051b3
|
|
BLAKE2b-256 checksum How to use checksums |
efdbddf211ef47ead4b2002b37cb10b75b2f01c07255b79e21386203d8264911
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Release files / embeddingdb-0.0.1-py3-none-any.whl
| Download URL | embeddingdb-0.0.1-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42d77278149dabad4c5771c4764654e3a61d28e770da6da85ff769d9cfffc6bc
|
|
BLAKE2b-256 checksum How to use checksums |
265ae438bd17b1d42760824f5b3aab6b53457be6de25607824c4dfda2a2b44d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for embeddingdb 0.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.