A short text analysis example

As the first test, let's call the new scoring method in the ScoreTweet function.

As mentioned earlier, you could potentially send the entire tweet as a whole, or even a list of up to a 1,000 tweets in a single call to the text sentiment API. In our implementation, we will break the tweets, however short, into separate sentences, and average the scores.

The full ScoreTweet.cs code is included in the following code snippet for completeness:

    using System.Net.Http;    using Microsoft.Azure.WebJobs;    using Microsoft.Azure.WebJobs.Host;    using Newtonsoft.Json;    namespace TextEvaluation   {    public static class ScoreTweet     {       [FunctionName("ScoreTweet")]       public static async Task Run([HttpTrigger(WebHookType =  "genericJson")]HttpRequestMessage ...

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.