#NEWLINE# @ app . route ( '/<username>/viz_tm/<int:folder_id>/' ) #NEWLINE# def topic_model_viz( username = None , folder_id = None ) : #NEWLINE# #INDENT# 'serve the topic model visualization' #NEWLINE# f = Folder . query . get ( f ) #NEWLINE# ex = Experiment . query . get ( f . tm_id ) #NEWLINE# ei = ex . getExInfo ( ) #NEWLINE# vocabfile = f . vocab_path ( ) #NEWLINE# vocab = [ x . strip ( ) for x in open ( vocabfile , 'r' ) ] #NEWLINE# totalDox = f . N ( ) #NEWLINE# return render_template ( 'topicmodel.html' , d = f , ex = ex , vocab = vocab , totalDox = totalDox , stopwords = ' ' . join ( ei . stopwords ) )