@app.route('/v' + API_VERSION + '/deployments/<int:deployment_id>/similar', methods=['POST'])
def similar_messages(deployment_id):
    if not request.json and 'text' not in request.json:
        abort(400)
    verify_deployment(deployment_od)
    if deployment is None:
        app.logger.debug("The deployment %d does not exist" % deployment_id)
        abort(404)
    # Get all the messages for the deployment
    models = db.session.query(Message).\
        filter_by(deployment_id == deployment_id).\
        all()
    count = int(request.json['count']) if 'count' in request.json else None
    messages = compute_similarities(request.json['text'], messages, count)
    return jsonify(messages)
Given text, finds the near duplicate messages. The duplicate messages
dataset/ETHPy150Open dssg/ushine-learning/dssg/webapp/rest_api.py/similar_messages