Skip to main content

Python bindings for ArrowSpace (Rust) providing graph-based similarity search, signal graphs, and spectral methods for vector data.

Project description

pyarrowspace

Python bindings for arrowspace-rs. This is experimental software meant for research at current state.

This is the starting repository for arrowspace, it is made public as a showcase for the Python interface, to collect feedback and make public some results of the tests run. To run needs the arrowspace-rs Rust module in a sibling directory.

For labs and tests please see tests/

Installation

From PyPi:

pip install arrowspace

or any other way of installing a Python library.

If you have cargo installed, to compile the libraries involved (from crates.io):

pip install maturin[patchelf]
maturin develop

Tests

Simple test:

python tests/test_0.py

Test with public QA dataset:

python tests/test_1_quora_questions.py

There are other tests but they require downloadin a dataset separately or fine-tuning the embeddings on a given dataset. Give it a try and let me know!

Simplest Example

from arrowspace import ArrowSpaceBuilder
import numpy as np

items: np.array = np.array(
    [[0.1, 0.2, 0.3], [0.0, 0.5, 0.1], [0.9, 0.1, 0.0]],
    dtype = np.float64
)

graph_params: dict = {
    "eps": 1.0,
    "k": 6,
    "topk": 3,
    "p": 2.0,
    "sigma": 1.0,
}

# Create an ArrowSpace instance, returning the computed
# signal graph and lambdas
aspace, gl = ArrowSpaceBuilder.build(graph_params, items)

# Search comparable items
# defaults: k = nitems, alpha = 0.9, beta = 0.1
query: np.array = np.array(
    [0.05, 0.2, 0.25],
    dtype = np.float64
)

tau: float = 1.0
hits: list = aspace.search(query, gl, tau)

# Search returns a list of `(index, score`) tuples, where
# expected value from the code above show the first index
# having the top score, i.e., being nearest.

print(hits)
# [ (0, 0.989743318610787), (1, 0.7565344158360029), (2, 0.22151940739207396) ]

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

arrowspace-0.24.7-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

arrowspace-0.24.7-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

arrowspace-0.24.7-cp314-cp314-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

arrowspace-0.24.7-cp314-cp314-macosx_10_12_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

arrowspace-0.24.7-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ARM64

arrowspace-0.24.7-cp313-cp313-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.13Windows x86-64

arrowspace-0.24.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

arrowspace-0.24.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

arrowspace-0.24.7-cp313-cp313-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

arrowspace-0.24.7-cp313-cp313-macosx_10_12_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

arrowspace-0.24.7-cp312-cp312-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.12Windows x86-64

arrowspace-0.24.7-cp312-cp312-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

arrowspace-0.24.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

arrowspace-0.24.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

arrowspace-0.24.7-cp312-cp312-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

arrowspace-0.24.7-cp312-cp312-macosx_10_12_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file arrowspace-0.24.7-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09e80e91d41bbaef35466e4829fd32a5a164da06780c7047dd383d19faad5f03
MD5 8a74b479f01ce7be78e2f01f6499c0fe
BLAKE2b-256 b554993e83117e8c0a1ac09583fef2a8478e59bd43d383108d707765b30364f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2862e3fd036854ae1d52db4108f04e36ecfff7dca46d286edc4bbd76add59d55
MD5 a026be7f0558a36e27a5f1912be8c2f7
BLAKE2b-256 6ba7cafb4593bd446faed74bd594553e75b28b3dc74775d6ad66d8766805dd15

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7908c01c23ad2b5126b0877858ca01215ccda3ab09ed11eedbd97fb45e8da2df
MD5 dc95f04fee8300dfd35b42f8a0a7b832
BLAKE2b-256 aadc5bedbd8128776651f9f84fe18b43367fa4235e4e20ce3b0527a6031d3e32

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7f245b42279865f0bc5a0741b6ba9066a3c0f3ec939f17f106f0c21b6bb825cc
MD5 9c77adb70fdee55ba39331d77e4100b8
BLAKE2b-256 6e7b14e4212b3573d91873cd6cb8deabf959b706330336f2e62d673659be7905

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 893200cc79181ab57f53983d51151fe1286ac0bcc07ddcfd02c627359a90f153
MD5 057bd0cd3b756495098ab73e4599c4c6
BLAKE2b-256 ca4e2bb692dbeb3c3310708d692535a0f40f3db7a9b2c6352f3da952ad10bfc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c7ee9a7d0de19f91a6652e47a5ca07631108974930f97e4bc9ee3717a49fc3a6
MD5 cc3a435a867f7a4fce455062f45d0e18
BLAKE2b-256 115a4cb6ae66002ac1569e56a50d8123c72b2a4825779783539485eb0d3e9156

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp313-cp313-win_amd64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61ee6f8075be5e67f8cd75e9df4f4ddd8d2ac8ac01ef2b4925ebfd84df8b380f
MD5 28fc23494039f648a5be629b62c104b0
BLAKE2b-256 64da42062b36e0f23084469a2475ad3a7612e202601dc0379f1fbb417f9fe987

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2c970af3ddf985804d97aad003d3ab5558281b992b5a9f3795896d5a1d881480
MD5 3a1d0131381ffe8f151dae3f0bc0ff1e
BLAKE2b-256 30854193f774077f3ff735b64a9aea9d791025beb23df1b1b1b77a5ece733232

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d1354be6e9bbcd5d28e9a3f0328e25bfa99dea924b6edb66266d811de5f980b0
MD5 080648709d5d25c0add5247a58349f47
BLAKE2b-256 d73e3554b51306768819528f31cf81618189a5460bf13c9db50da82dc3115a32

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d090e3d99c9af8597e39550f3fa4082f6387ca9b730a64a8e190103373e10d6f
MD5 c0640d0b18620f0355d9f52972c355c6
BLAKE2b-256 1980cbd30c5ff33036e55ab0156e657deb6672703534f030dd855eb5b8da5618

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2eea94fa03d9c1d7b00f221d9ebf052d0aac28be2c8e90afd4c8c917e3203200
MD5 544283006395debef4f92eb21656d4f6
BLAKE2b-256 91eca5a804f97b5495719ee99efa13e2aa0d9fec20328966e529d753ef0a1f1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp312-cp312-win_amd64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8dee4a4926caa36c9402b2b443976360c539626419c08d22bc1630e8488d5dcc
MD5 6cf0ffb0b05c7204ef47e360a88cd84a
BLAKE2b-256 d6df01c918c87e1e82d984d89db8029c06ed652b46f27dedaec1ac6ed991e7e8

See more details on using hashes here.

File details

Details for the file arrowspace-0.24.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa5d3d1a894b87f6a2f3f62ff956579c2ed04e0ab7ce93ae64a40f19d51d5cf4
MD5 678396b6d0416828117f5c18cb6ed8d9
BLAKE2b-256 e778ebb2b73349000bd5bd3c834ca985f8d4ec7c4d2b66b80c4f77c0b718033f

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 83c27d1195ee78aa3ef1229638367f618c62c72371a0b9342f8196db71ec4f12
MD5 db09a10d59ac95c32ffb551f115c0821
BLAKE2b-256 2a40204be7c2bd2885e5302de63d6af75cbf474ea3db3a22d5376081c46e05a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e40c66a0c54aee0b367e1507660d383355ba5b1fc1a72653eae09fd58804f712
MD5 cf68d25f56a70dae9f147c8d69887e4d
BLAKE2b-256 9c3778bb3edfd2d4e9243a7471d971f013fcd3a9310c457b842dda427a6ca54e

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.24.7-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.24.7-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0f91b422a3771802a5cb258c9f3292102e26f56ffe803f4d7103a99e3119e954
MD5 c3c250156fb72104cb46d099cbf83832
BLAKE2b-256 b90497488ff0910c23e56dfb321304078b88c45eee8f70eb51627246933cabdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.24.7-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page