@app.route('/recommend', methods=['GET'])
def recommend():
 ttstr = request.args.get('timefilter', 'week')
 vstr = request.args.get('vfilter', 'all')
 legend = {'day': 1, '3days': 3, 'week': 7, 'month': 30, 'year': 365}
 tt = legend.get(ttstr, None)
 papers = papers_from_svm(recent_days=tt)
 papers = papers_filter_version(papers, vstr)
 ctx = default_context(papers, render_format='recommend', msg=('Recommended papers: (based on SVM trained on tfidf of papers in your library, refreshed every day or so)' if g.user else 'You must be logged in and have some papers saved in your library.'))
 return render_template('main.html', **ctx)

@ app . route ( '/recommend' , methods = [ 'GET' ] ) def recommend ( ) : ttstr = request . args . get ( 'timefilter' , 'week' ) vstr = request . args . get ( 'vfilter' , 'all' ) legend = { 'day' : 1 , '3days' : 3 , 'week' : 7 , 'month' : 30 , 'year' : 365 } tt = legend . get ( ttstr , None ) papers = papers_from_svm ( recent_days = tt ) papers = papers_filter_version ( papers , vstr ) ctx = default_context ( papers , render_format = 'recommend' , msg = ( 'Recommended papers: (based on SVM trained on tfidf of papers in your library, refreshed every day or so)' if g . user else 'You must be logged in and have some papers saved in your library.' ) ) return render_template ( 'main.html' , ** ctx )
return users svm sorted list .