mirror of
https://git.freebsd.org/ports.git
synced 2025-05-05 16:07:38 -04:00
7 lines
243 B
Python
7 lines
243 B
Python
from annoy import AnnoyIndex
|
|
|
|
f = 40 # Length of item vector that will be indexed
|
|
|
|
u = AnnoyIndex(f, 'angular')
|
|
u.load('test.ann') # super fast, will just mmap the file
|
|
print(u.get_nns_by_item(0, 1000)) # will find the 1000 nearest neighbors
|