Skip to main content

ANN-interface librsry

Project description

Annime Project

Overview

Annime (Approximate Nearest Neighbors Interface for Metrics Evaluation) is an open-source library that provides a unified interface for various Approximate Nearest Neighbor (ANN) implementations. It supports multiple ANN libraries including Annoy, NGT, NMSLIB, Faiss, Hnswlib, ScaNN, and Datasketch. This library is designed to simplify the process of benchmarking and evaluating the performance of different ANN algorithms.

Features

  • Unified interface for multiple ANN libraries
  • Easy integration and usage
  • Comprehensive set of methods for building, querying, and managing ANN indices
  • Benchmarking and performance evaluation tools

Installation

To install Annime, clone the repository and install the dependencies using pip:

git clone https://github.com/Azherhs/Annime.git
cd Annime
pip install -r requirements.txt

or

pip install annime

Usage

To use the Annime library, import the specific ANN interface you need and follow the provided examples:

Example with Annoy

from annime.annoy_int import AnnoyANN

# Initialize the Annoy interface
annoy_ann = AnnoyANN(dim=100, metric='euclidean')

# Build the index with your data
data_points = ...  # Your ndarray data points
annoy_ann.build_index(data_points)

# Query the index
query_point = ...  # Your query point
results = annoy_ann.query(query_point, k=5)
print(results)

Example with NMSLIB

from annime.nmslib_int import NmslibANN

# Initialize the NMSLIB interface
nmslib_ann = NmslibANN(space='l2', method='hnsw')

# Build the index with your data
data_points = ...  # Your ndarray data points
nmslib_ann.build_index(data_points)

# Query the index
query_point = ...  # Your query point
results = nmslib_ann.query(query_point, k=5)
print(results)

Running Tests

To ensure that everything is working correctly, you can run the provided tests using pytest:

pytest

Supported Libraries

Annime currently supports the following ANN libraries:

  • Annoy
  • Datasketch
  • Faiss
  • Hnswlib
  • NGT
  • NMSLIB
  • ScaNN

Contributing

We welcome contributions from the community! If you would like to contribute to Annime, please follow these steps:

  • Fork the repository.
  • Create a new branch for your feature or bugfix.
  • Implement your changes and commit them to your branch.
  • Submit a pull request detailing your changes.

Please ensure your code adheres to the project's coding standards and includes appropriate tests.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any inquiries or issues, please open an issue on the GitHub repository.

Project details


Download files

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

Source Distribution

annime-0.1.0.tar.gz (55.7 kB view hashes)

Uploaded Source

Built Distribution

annime-0.1.0-py3-none-any.whl (91.2 kB view hashes)

Uploaded Python 3

Supported by

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