Book Image

Learning Microsoft Cognitive Services - Third Edition

By : Leif Larsen
Book Image

Learning Microsoft Cognitive Services - Third Edition

By: Leif Larsen

Overview of this book

Microsoft Cognitive Services is a set of APIs for integrating artificial intelligence in your applications to solve logical business problems. If you’re new to developing applications with AI, Learning Microsoft Cognitive Services will give you a comprehensive introduction to Microsoft’s AI stack and get you up-to-speed in no time. The book introduces you to 24 APIs, including Emotion, Language, Vision, Speech, Knowledge, and Search. Using Visual Studio, you can develop applications with enhanced capabilities for image processing, speech recognition, text processing, and much more. Moving forward, you will work with datasets that enable your applications to process various data in the form of image, video, or text. By the end of the book, you’ll be able to confidently explore Cognitive Services APIs for building intelligent applications that can be deployed for real-world business uses.
Table of Contents (17 chapters)
Learning Microsoft Cognitive Services - Third Edition
Contributors
Acknowledgments
Preface
Index

Local hosting and testing


With the index and grammar in place, we can go on to test the service locally. Locally testing the service allows for rapid prototyping, which allows us to define the scheme and grammar quickly.

When we are testing locally, the KES only supports up to 10,000 objects and 10 requests per second. It also terminates after a total of 1,000 requests have been executed. We will learn how to bypass these restrictions in a bit.

To host the KES locally, run the following command:

Kes.exe host_service Academic.grammar Academic.index -port 8080

This will start up the service, running on port 8080. To verify that it is working as intended, open your browser and go to http://localhost:8080.

Doing so should present you with the following screen:

Running the KES as a local service also allows us to use the academic API for testing. We are going to make some modifications to our example application—created for the academic API—in order to support this.

First, we are going to modify the...