@app.route('/v' + API_VERSION + '/language', methods=['POST'])
def detect_language():
    if not request.json or not 'text' in request.json:
        abort(400)
    language = Machine.guess_language(request.json['text'])[0]

    return jsonify({'language': language[0], "confidence": language[1]})
Given some text, returns a ranked list of likey natural languages
dataset/ETHPy150Open dssg/ushine-learning/dssg/webapp/rest_api.py/detect_language