import json


def to_sentiment_json(doc_id, sent, label):
    """Convert the sentiment info to json.

    Args:
        doc_id: Document id
        sent: Overall Sentiment for the document
        label: Actual label +1, 0, -1 for the document

    Returns:
        String json representation of the input

    """
    json_doc = {}

    json_doc['doc_id'] = doc_id
    json_doc['sentiment'] = float('%.3f' % sent)
    json_doc['label'] = label

    return json.dumps(json_doc)