parameters: (request)
return_statement: return JsonResponse(serializer.data)
docstring: save the labeled annotation to DB
      :return:
docstring_summary: save the labeled annotation to DB
      :return:
docstring_tokens: save the labeled annotation to DB : return :
function: 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)
function_tokens: 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 )