Fareast
This library is a rust port of spotify/annoy , currently only index serving is supported.
It also provides FFI bindings for jvm, dotnet and dart
Metric | Serve | Build | jvm Binding | dotnet Binding | dart Binding |
---|---|---|---|---|---|
Angular |
|
|
|
|
|
Euclidean |
|
|
|
|
|
Manhattan |
|
|
|
|
|
Dot |
|
|
|
|
|
Hamming |
|
|
|
|
|
crates.io
Install via# Cargo.toml
[dependencies]
annoy-rs = "0"
Usage
use annoy_rs::*;
let index = AnnoyIndex::load(10, "index.ann", IndexType::Angular).unwrap();
let v0 = index.get_item_vector(0);
let nearest = index.get_nearest(v0.as_ref(), 5, -1, true);
FFI support
kotlin/java
It uses JNI bindings to rust crate and is ~5-10x faster than pure java implementation in benchmark scenario
jitpack.io
Install viarepositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.ng8eke:Fareast:'
}
Usage
val index = AnnoyIndex.tryLoad("index.5d.ann", 5, IndexType.Angular)
dotnet
Runtimes | Nuget package |
---|---|
Fareast | |
Fareast-Batteries-Windows-x64 | |
Fareast-Batteries-Linux-x64 | |
Fareast-Batteries-Darwin-x64 |
Install via nuget
<ItemGroup> <PackageReference Include="Fareast" Version="*" /> <PackageReference Include="Fareast-Batteries-Windows-x64" Version="*" /> ItemGroup>