def on_get(self, req, resp, model_name):
try:
model = get_model(model_name)
output = {
'dep_types': get_dep_types(model),
'ent_types': get_ent_types(model),
'pos_types': get_pos_types(model)
}
resp.body = json.dumps(output, sort_keys=True, indent=2)
resp.content_type = 'text/string'
resp.append_header('Access-Control-Allow-Origin', "*")
resp.status = falcon.HTTP_200
except Exception as e:
raise falcon.HTTPBadRequest(
'Schema construction failed',
'{}'.format(e))
resp.status = falcon.HTTP_500
评论列表
文章目录