Skip to content
Permalink
Browse files

working on bottle to flask

  • Loading branch information...
kirtansakariya committed Sep 15, 2019
1 parent b6d90f1 commit 7db5a6a364c02d152cc0ac2b696fa5c676503df8
Showing with 1,427 additions and 9 deletions.
  1. +5 −5 topicexplorer/__main__.py
  2. +3 −3 topicexplorer/extensions/ap.py
  3. +1,047 −0 topicexplorer/server_flask.py
  4. +195 −0 www/master.html
  5. +1 −1 www/master.mustache.html
  6. +176 −0 www/splash.html
@@ -28,7 +28,7 @@
import platform
import warnings

from topicexplorer import (init, prep, train, server, notebook,
from topicexplorer import (init, prep, train, server_flask, notebook,
demo, update, metadata, export, tezimport, export_html)

from topicexplorer.lib.util import is_valid_filepath
@@ -115,14 +115,14 @@ def main():

# Launch Parser
parser_launch = parsers.add_parser('launch', help="Serve the trained LDA models")
server.populate_parser(parser_launch)
server_flask.populate_parser(parser_launch)
parser_launch.set_defaults(func="launch")

# Serve Parser
parser_serve = parsers.add_parser('serve',
help="Serve a single LDA model, helper for `topicexplorer launch`," +
"rarely called directly")
server.populate_parser(parser_serve)
server_flask.populate_parser(parser_serve)
parser_serve.set_defaults(func="serve")

# Notebook Parser
@@ -250,8 +250,8 @@ def benchmark(fn):
elif args.func == 'launch' or args.func == 'serve':
# Note that we are only benchmarking the creation process - obviously
# benches of the serve process will take longer
app = benchmark(server.create_app)(args)
server.main(args, app)
app = benchmark(server_flask.create_app)(args)
server_flask.main(args, app)


elif args.func == 'notebook':
@@ -15,9 +15,9 @@ def init(app, config_file):

raw_corpus_path = config.get('main', 'raw_corpus', fallback='ap/')

@app.route('/fulltext/<doc_id>')
def get_doc(doc_id):
return static_file(doc_id, root=raw_corpus_path)
# @app.route('/fulltext/<doc_id>')
# def get_doc(doc_id):
# return static_file(doc_id, root=raw_corpus_path)


def label(doc):

0 comments on commit 7db5a6a

Please sign in to comment.
You can’t perform that action at this time.