forked from jodaiber/semantic_compound_splitting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
annoying_test.py
42 lines (28 loc) · 792 Bytes
/
annoying_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from annoy import AnnoyIndex
raw_input("<Enter> to create tree.")
tree = AnnoyIndex(500)
raw_input("<Enter> to load tree.")
tree.load("test_tree.ann")
raw_input("<Enter> to load 10,000 vectors.")
q = True
while q:
for i in xrange(10000):
tree.get_item_vector(i)
resp = raw_input("<Enter> to load 10,000 vectors.")
if resp.strip() == "q":
q = False
raw_input("<Enter> to unload tree.")
tree.unload("test_tree.ann")
raw_input("done.")
tree.load("test_tree.ann")
raw_input("<Enter> to load 10,000 vectors.")
q = True
while q:
for i in xrange(10000):
tree.get_item_vector(i)
resp = raw_input("<Enter> to load 10,000 vectors.")
if resp.strip() == "q":
q = False
raw_input("<Enter> to delete tree.")
del tree
raw_input("done.")