Constructing the payload

As discussed in the preceding section, the text sentiment analytics API expects the payload to be broken down into a potentially large number of relatively small "documents". When working with short snippets of text, such as tweets or SMS messages, the entire message can be submitted for scoring as a single document. As we move to work with larger texts, the text needs to be split up to avoid reaching the 10 KB limit of a single document. As we move to work with even larger texts, the total input limit of 1 MB per API call also needs to be taken into consideration.

In our implementation of constructing the payload, we will implement a one-size-fits-all approach, which will allow us to process text of any size.

We ...

Get Serverless computing in Azure with .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.