(request)
return JsonResponse(serializer.data)
save the labeled annotation to DB
    :return:
save the labeled annotation to DB
    :return:
save the labeled annotation to DB : return :
def annotate_single_unlabeled(request):
    """
    save the labeled annotation to DB
    :return:
    """
    # read file
    text = request.POST.get("text", "")
    label = request.POST.get("label", "")
    uuid = request.POST.get("uuid", "")

    ca = get_mongo_client(uri='mongodb://localhost:27017/')

    raw_text = ca["annotation_raw_data"].find_one({"uuid": uuid})
    if raw_text:
        ca["annotation_raw_data"].update({"uuid": uuid}, {"$set": {"labeled": True}})

        annotation_data = AnnotationData(text=text, label=label, uuid=uuid, dataset_uuid=raw_text.get("dataset_uuid"))
        annotation_data_serializer = AnnotationDataSerializer(annotation_data)
        ca["annotation_data"].insert_one(annotation_data_serializer.data)

    response = APIResponse()
    response.data = {"status": "success"}
    response.code = 200
    response.message = "SUCCESS"
    serializer = APIResponseSerializer(response)
    return JsonResponse(serializer.data)
def annotate_single_unlabeled ( request ) : # read file text = request . POST . get ( "text" , "" ) label = request . POST . get ( "label" , "" ) uuid = request . POST . get ( "uuid" , "" ) ca = get_mongo_client ( uri = 'mongodb://localhost:27017/' ) raw_text = ca [ "annotation_raw_data" ] . find_one ( { "uuid" : uuid } ) if raw_text : ca [ "annotation_raw_data" ] . update ( { "uuid" : uuid } , { "$set" : { "labeled" : True } } ) annotation_data = AnnotationData ( text = text , label = label , uuid = uuid , dataset_uuid = raw_text . get ( "dataset_uuid" ) ) annotation_data_serializer = AnnotationDataSerializer ( annotation_data ) ca [ "annotation_data" ] . insert_one ( annotation_data_serializer . data ) response = APIResponse ( ) response . data = { "status" : "success" } response . code = 200 response . message = "SUCCESS" serializer = APIResponseSerializer ( response ) return JsonResponse ( serializer . data )