Skip to content

Instantly share code, notes, and snippets.

@CognitiveDave
Last active April 6, 2021 18:52
Show Gist options
  • Save CognitiveDave/b18c81e363c283d59921dcc594e22c52 to your computer and use it in GitHub Desktop.
Save CognitiveDave/b18c81e363c283d59921dcc594e22c52 to your computer and use it in GitHub Desktop.
@app.route('/keywords', methods=['GET','POST'])
def keywords():
response_object = {'keywords': ['birds','scatt']}
post_data = request.get_json()
if post_data['text'] != None:
keywords = LangServices.keywords(post_data['text'])
if len(keywords) > 0:
response_object = {'keywords' : keywords['ranked phrases']}
return jsonify(response_object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment