-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtile_generator.py
executable file
·71 lines (43 loc) · 1.26 KB
/
tile_generator.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import database_wrapper as DBWrapper
import nmf_core as NMFCore
import logging, logging.config
class TileGenerator():
def __init__(self, DB):
self.db = DB
return;
def load_raw_data(self):
return "";
def store_raw_data(self):
return "";
def make_dictionary(self):
return "";
def store_dictionary(self):
return "";
def make_term_doc_matrix(self):
return "";
def store_term_doc_matrix(self):
return "";
def make_tile(self):
return "";
def store_tiles(self):
return "";
def make_default_tiles(self):
self.load_raw_data()
self.store_raw_data()
self.make_dictionary()
self.store_dictionary()
self.make_term_doc_matrix()
self.store_term_doc_matrix()
self.make_tile()
self.store_tiles()
return;
def run_topic_modeling(self, topic_modeling_module, num_clusters, num_keywords, exclusiveness):
logging.debug('run_topic_modeling')
# for every zoom level
for level in range(7, 13):
# every tile in this zoom level
for tile in range(1, 20):
# calculate topic modeling on the fly
nmf_result = topic_modeling_module.get_topics(level, tile, topic_modeling_module.MAX_NUM_CLUSTERS, topic_modeling_module.MAX_NUM_KEYWORDS, "", "", 0, "", 1)
self.db.set_topic_modeling_result(level, tile, nmf_result)
return;