1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-06-26 07:00:31 -04:00
ports/math/py-annoy/files/test-load.py

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