public virtual POSTagsTextAnalysisResponse GetPOSTagsTextAnalysis(TextAnalysisRequest request) { request.AnalyzerIds = new[] { AnalyzerIds[AnalyzerType.PartsOfSpeech] }; var response = RepositoryClient.SendJsonPost(ApiKeys.LinguisticAnalysis, $"{ApiKeys.LinguisticAnalysisEndpoint}{textAnalysisUrl}", JsonConvert.SerializeObject(request)); return(JsonConvert.DeserializeObject <List <POSTagsTextAnalysisResponse> >(response).First()); }
public virtual Emotion[] Recognize(string imageUrl, Rectangle[] faceRectangles) { var qs = GetRectangleQS(faceRectangles); var response = RepositoryClient.SendJsonPost(ApiKeys.Emotion, $"{ApiKeys.EmotionEndpoint}recognize{qs}", JsonConvert.SerializeObject(new Asset { Url = imageUrl })); return(JsonConvert.DeserializeObject <Emotion[]>(response)); }
public virtual CreateProfileResponse CreateProfile(string locale) { var response = RepositoryClient.SendJsonPost(ApiKeys.SpeakerRecognition, $"{ApiKeys.SpeakerRecognition}identificationProfiles", JsonConvert.SerializeObject(new LocaleSetting { Locale = locale })); return(JsonConvert.DeserializeObject <CreateProfileResponse>(response)); }
public virtual AnalysisResult AnalyzeImage(string imageUrl, IEnumerable <VisualFeature> visualFeatures = null, IEnumerable <string> details = null) { var qs = GetAnalyzeQuerystring(visualFeatures, details); var response = RepositoryClient.SendJsonPost(ApiKeys.ComputerVision, $"{ApiKeys.ComputerVisionEndpoint}analyze{qs}", GetImageUrlJson(imageUrl)); return(JsonConvert.DeserializeObject <AnalysisResult>(response)); }
public virtual BreakIntoWordsResponse BreakIntoWords(WebLMModelOptions model, string text, int order = 5, int maxNumOfCandidatesReturned = 5) { var response = RepositoryClient.SendJsonPost(ApiKeys.WebLM, $"{ApiKeys.WebLMEndpoint}breakIntoWords?model={model}&text={text}&order={order}&maxNumOfCandidatesReturned={maxNumOfCandidatesReturned}", ""); return(JsonConvert.DeserializeObject <BreakIntoWordsResponse>(response)); }
public virtual LanguageResponse GetLanguages(LanguageRequest request) { var response = RepositoryClient.SendJsonPost(ApiKeys.TextAnalytics, GetLanguageUrl(request), JsonConvert.SerializeObject(request)); return(JsonConvert.DeserializeObject <LanguageResponse>(response)); }
public virtual KnowledgeBaseExtractionDetails CreateKnowledgeBase(KnowledgeBaseDetails request) { var response = RepositoryClient.SendJsonPost(ApiKeys.QnA, $"{ApiKeys.QnAEndpoint}create", JsonConvert.SerializeObject(request)); return(JsonConvert.DeserializeObject <KnowledgeBaseExtractionDetails>(response)); }
public virtual EvaluateResponse Evaluate(string imageUrl) { var response = RepositoryClient.SendJsonPost(ApiKeys.ContentModerator, $"{ApiKeys.ContentModeratorEndpoint}{moderatorUrl}/ProcessImage/Evaluate", GetImageUrlData(imageUrl)); return(JsonConvert.DeserializeObject <EvaluateResponse>(response)); }
public virtual GraphSearchResponse GraphSearch(GraphSearchRequest request) { var response = RepositoryClient.SendJsonPost(ApiKeys.Academic, $"{ApiKeys.AcademicEndpoint}{graphUrl}?mode=json", JsonConvert.SerializeObject(request)); return(JsonConvert.DeserializeObject <GraphSearchResponse>(response)); }
public virtual Face[] Detect(string imageUrl, bool returnFaceId = true, bool returnFaceLandmarks = false, IEnumerable <FaceAttributeType> returnFaceAttributes = null) { var qs = GetDetectQS(returnFaceId, returnFaceLandmarks, returnFaceAttributes); var response = RepositoryClient.SendJsonPost(ApiKeys.Face, $"{ApiKeys.FaceEndpoint}detect{qs}", JsonConvert.SerializeObject(new Image { Url = imageUrl })); return(JsonConvert.DeserializeObject <Face[]>(response)); }
public ClientConfiguration GetClientConfiguration() { var response = RepositoryClient.SendJsonPost(ApiKeys.Personalizer, $"{ApiKeys.PersonalizerEndpoint}configurations/client", string.Empty); return(JsonConvert.DeserializeObject <ClientConfiguration>(response)); }
public virtual CreateBusinessRuleResponse CreateBusinessRule(string modelId, CreateBusinessRuleRequest request) { var response = RepositoryClient.SendJsonPost(ApiKeys.Recommendations, $"{ApiKeys.RecommendationsEndpoint}{modelsUrl}{modelId}/rules", JsonConvert.SerializeObject(request)); return(JsonConvert.DeserializeObject <CreateBusinessRuleResponse>(response)); }