All Projects → yahoojapan → gongt

yahoojapan / gongt

Licence: Apache-2.0 license
NGT Go client library

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to gongt

spark-annoy
Building Annoy Index on Apache Spark
Stars: ✭ 73 (+151.72%)
Mutual labels:  approximate-nearest-neighbor-search
instant-distance
Fast approximate nearest neighbor searching in Rust, based on HNSW index
Stars: ✭ 140 (+382.76%)
Mutual labels:  approximate-nearest-neighbor-search
scikit-hubness
A Python package for hubness analysis and high-dimensional data mining
Stars: ✭ 41 (+41.38%)
Mutual labels:  approximate-nearest-neighbor-search
pqlite
⚡ A fast embedded library for approximate nearest neighbor search
Stars: ✭ 141 (+386.21%)
Mutual labels:  approximate-nearest-neighbor-search
Annoy
Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk
Stars: ✭ 9,262 (+31837.93%)
Mutual labels:  approximate-nearest-neighbor-search
Milvus
An open-source vector database for embedding similarity search and AI applications.
Stars: ✭ 9,015 (+30986.21%)
Mutual labels:  approximate-nearest-neighbor-search
pgvector
Open-source vector similarity search for Postgres
Stars: ✭ 482 (+1562.07%)
Mutual labels:  approximate-nearest-neighbor-search
adventures-with-ann
All the code for a series of Medium articles on Approximate Nearest Neighbors
Stars: ✭ 40 (+37.93%)
Mutual labels:  approximate-nearest-neighbor-search
elasticsearch-approximate-nearest-neighbor
Plugin to integrate approximate nearest neighbor(ANN) search with Elasticsearch
Stars: ✭ 53 (+82.76%)
Mutual labels:  approximate-nearest-neighbor-search
NearestNeighborDescent.jl
Efficient approximate k-nearest neighbors graph construction and search in Julia
Stars: ✭ 34 (+17.24%)
Mutual labels:  approximate-nearest-neighbor-search
annoy.rb
annoy-rb provides Ruby bindings for the Annoy (Approximate Nearest Neighbors Oh Yeah).
Stars: ✭ 23 (-20.69%)
Mutual labels:  approximate-nearest-neighbor-search
product-quantization
🙃Implementation of vector quantization algorithms, codes for Norm-Explicit Quantization: Improving Vector Quantization for Maximum Inner Product Search.
Stars: ✭ 40 (+37.93%)
Mutual labels:  approximate-nearest-neighbor-search
lshensemble
LSH index for approximate set containment search
Stars: ✭ 48 (+65.52%)
Mutual labels:  approximate-nearest-neighbor-search

gongt License: Apache release CircleCI codecov Go Report Card GoDoc Join the chat at https://gitter.im/yahoojapan/gongt

Description

gongt provides Go API for NGT.

NGT is Neighborhood Graph and Tree for Indexing High-dimensional Data. If you want more information, please read NGT repository.

Dependency

Installation

$ go get -u github.com/yahoojapan/gongt

Example

package main

import (
	"fmt"

	"github.com/yahoojapan/gongt"
)

func main() {
	defer gongt.Get().SetIndexPath("assets/example").Open().Close()
	if errs := gongt.GetErrors(); len(errs) > 0 {
		panic(errs)
	}

	fmt.Printf("Dimension: %d\n", gongt.GetDim())

	query := []float64{12, 17, 21, 18, 17, 31, 33, 25, 26, 19, 42, 31, 25, 26, 49, 30, 19, 23, 29, 29, 22, 19, 28, 27, 28, 19, 13, 12, 25, 21, 25, 21, 35, 12, 44, 36, 19, 49, 104, 33, 29, 77, 43, 36, 28, 44, 90, 46, 52, 37, 65, 42, 33, 40, 104, 103, 44, 26, 50, 43, 18, 20, 48, 68, 28, 16, 104, 27, 6, 36, 98, 327, 53, 81, 40, 36, 61, 104, 44, 27, 42, 84, 55, 54, 49, 53, 28, 27, 103, 42, 27, 28, 24, 53, 60, 66, 7, 42, 14, 6, 32, 69, 15, 3, 4, 79, 27, 7, 30, 82, 26, 3, 15, 27, 18, 6, 19, 52, 21, 16, 104, 72, 30, 40, 22, 36, 19, 22}

	results, err := gongt.Search(query, 10, gongt.DefaultEpsilon)

	if err != nil {
		fmt.Println(err.Error())
		return
	}

	for i, r := range results {
		fmt.Printf("Rank %d\n", i+1)
		fmt.Printf("  ID: %d\n", r.ID)
		fmt.Printf("  Distance: %f\n", r.Distance)
	}
}

result

$ go run example.go
Dimension: 128
Rank 1
  ID: 2892
  Distance: 273.355072
Rank 2
  ID: 2138
  Distance: 274.874512
Rank 3
  ID: 2422
  Distance: 276.372925
Rank 4
  ID: 1586
  Distance: 277.263428
Rank 5
  ID: 679
  Distance: 277.564392
Rank 6
  ID: 1564
  Distance: 278.792023
Rank 7
  ID: 2594
  Distance: 281.176086
Rank 8
  ID: 2159
  Distance: 281.895386
Rank 9
  ID: 2738
  Distance: 282.876312
Rank 10
  ID: 318
  Distance: 283.339020

License

Copyright (C) 2017 Yahoo Japan Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributor License Agreement

This project requires contributors to agree to a Contributor License Agreement (CLA).

Note that only for contributions to the gongt repository on the GitHub (https://github.com/yahoojapan/gongt), the contributors of them shall be deemed to have agreed to the CLA without individual written agreements.

Authors

Kosuke Morimoto
kpango

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].