-
Notifications
You must be signed in to change notification settings - Fork 14
/
main.py
executable file
·37 lines (33 loc) · 1.24 KB
/
main.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
import time
from debugger import Debugger
from source import Source
from bucket_chain import BucketChain
from clusters import Clusters
from online_clustering import OnlineClustering
from chrono import Chrono
from universe import Universe
def main():
debug = Debugger()
chrono = Chrono()
universe = Universe(debug)
source = Source(debug).get_source()
bucket_chain = BucketChain(debug, chrono, universe, source)
clusters = Clusters(debug, chrono, universe)
algorithm = OnlineClustering(debug, universe, bucket_chain, clusters)
while True:
operation_time = time.time()
if bucket_chain.is_updated():
universe.compute_log_n_df()
bucket_chain.compute_universal_counts()
bucket_chain.compute_universal_tfidf()
clusters.update_centroid_counts()
clusters.update_centroid_tfidf()
algorithm.pre_clustering_work()
algorithm.online_clustering()
clusters.remove_old_clusters()
universe.prune_terms(clusters)
debug.log("BUCKET FINISHED IN: "+str(time.time() - operation_time))
clusters.debug_active_clusters()
clusters.save_active_clusters()
if __name__=="__main__":
main()