From the course: Calling REST APIs with Java

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Challenge: Cognitive Services API

Challenge: Cognitive Services API - Java Tutorial

From the course: Calling REST APIs with Java

Challenge: Cognitive Services API

(upbeat music playing) - [Instructor] Now that we've seen the Java 11 HTTP Client and a few cognitive services inaction. Let's try a programming challenge. In this challenge, you're going to make an API call to the sentiment service within the text analytics API. After the API returns a response you'll work to parse out the sentiment data in order to create a sentiment analysis object. Let's take a closer look. Inside of your working files, you'll find the Azure sentiment service where you'll do most of your work, Inside of this class, there's a single method named requests sentiment analysis. It accepts two parameters of type string. The first is the text parameter which contains the text we'd like to send to Azure cognitive services for sentiment analysis. The second is the language parameter which will have the language code. If you're using English, this will be EN. Now within the body of this method you're…

Contents