Skip to content

Instantly share code, notes, and snippets.

@arihantdaga
Last active January 16, 2021 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arihantdaga/b701c780c6b0828eae7f083827c909f8 to your computer and use it in GitHub Desktop.
Save arihantdaga/b701c780c6b0828eae7f083827c909f8 to your computer and use it in GitHub Desktop.
from flask import Flask
from flask import request
app = Flask(__name__)
from mood_tagging import get_emotion
@app.route('/get_emotion', methods=['POST'])
def get_emotion_of_text():
if request.method == 'POST':
text = request.json.get('text')
return get_emotion(text)
if __name__ == "__main__":
app.run(host ='0.0.0.0', port = 5005, debug = True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment