/// <summary> /// The API returns a numeric score between 0 and 1. /// Scores close to 1 indicate positive sentiment, while /// scores close to 0 indicate negative sentiment. /// Sentiment score is generated using classification /// techniques. /// The input features to the classifier include n-grams, /// features generated from part-of-speech tags, and word embeddings. /// Currently, the following languages are supported: /// English, Spanish, French, Portuguese. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='multiLanguageBatchInputV2'> /// Optional. /// </param> public static object Sentiment(this ICustomerFinderCognitiveServicesClient operations, MultiLanguageBatchInputV2 multiLanguageBatchInputV2 = null) { return(Task.Factory.StartNew((object s) => { return ((ICustomerFinderCognitiveServicesClient)s).SentimentAsync(multiLanguageBatchInputV2); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The API returns the detected language and a numeric score between 0 /// and 1. /// Scores close to 1 indicate 100% certainty that the /// identified language is true. /// A total of 120 languages are supported. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='numberOfLanguagesToDetect'> /// Optional. Format - int32. (Optional) Number of languages to detect. /// Set to 1 by default. /// </param> /// <param name='batchInputV2'> /// Optional. /// </param> public static object DetectLanguage(this ICustomerFinderCognitiveServicesClient operations, int?numberOfLanguagesToDetect = null, BatchInputV2 batchInputV2 = null) { return(Task.Factory.StartNew((object s) => { return ((ICustomerFinderCognitiveServicesClient)s).DetectLanguageAsync(numberOfLanguagesToDetect, batchInputV2); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Get the status of an operation submitted for processing. If the the /// operation has reached a 'Succeeded' state, will also return the /// result. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='operationId'> /// Required. A unique id for the submitted operation. /// </param> public static object OperationStatus(this ICustomerFinderCognitiveServicesClient operations, string operationId) { return(Task.Factory.StartNew((object s) => { return ((ICustomerFinderCognitiveServicesClient)s).OperationStatusAsync(operationId); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The API returns the top detected topics for a list of submitted /// text documents. /// A topic is identified with a key phrase, which can be /// one or more related words. /// Use the URL parameters and stop word list to control /// which words or documents are filtered out. /// You can also supply a list of topics to exclude from /// the response. /// At least 100 text documents must be submitted, however /// it is designed to detect topics across hundreds to thousands of /// documents. /// Note that one transaction is charged per text document /// submitted. /// For best performance, limit each document to a short, /// human written text paragraph such as review, conversation or user /// feedback. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='minDocumentsPerWord'> /// Optional. Format - int32. (optional) Words that occur in less than /// this many documents are ignored. /// Use this parameter to help exclude rare document /// topics. /// Omit to let the service choose appropriate value. /// </param> /// <param name='maxDocumentsPerWord'> /// Optional. Format - int32. (optional) Words that occur in more than /// this many documents are ignored. /// Use this parameter to help exclude ubiquitous document /// topics. /// Omit to let the service choose appropriate value. /// </param> /// <param name='topicDetectionInputV2'> /// Optional. /// </param> public static ErrorResponse DetectTopics(this ICustomerFinderCognitiveServicesClient operations, int?minDocumentsPerWord = null, int?maxDocumentsPerWord = null, TopicDetectionInputV2 topicDetectionInputV2 = null) { return(Task.Factory.StartNew((object s) => { return ((ICustomerFinderCognitiveServicesClient)s).DetectTopicsAsync(minDocumentsPerWord, maxDocumentsPerWord, topicDetectionInputV2); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The API returns the detected language and a numeric score between 0 /// and 1. /// Scores close to 1 indicate 100% certainty that the /// identified language is true. /// A total of 120 languages are supported. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='numberOfLanguagesToDetect'> /// Optional. Format - int32. (Optional) Number of languages to detect. /// Set to 1 by default. /// </param> /// <param name='batchInputV2'> /// Optional. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <object> DetectLanguageAsync(this ICustomerFinderCognitiveServicesClient operations, int?numberOfLanguagesToDetect = null, BatchInputV2 batchInputV2 = null, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <object> result = await operations.DetectLanguageWithOperationResponseAsync(numberOfLanguagesToDetect, batchInputV2, cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <summary> /// The API returns a numeric score between 0 and 1. /// Scores close to 1 indicate positive sentiment, while /// scores close to 0 indicate negative sentiment. /// Sentiment score is generated using classification /// techniques. /// The input features to the classifier include n-grams, /// features generated from part-of-speech tags, and word embeddings. /// Currently, the following languages are supported: /// English, Spanish, French, Portuguese. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='multiLanguageBatchInputV2'> /// Optional. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <object> SentimentAsync(this ICustomerFinderCognitiveServicesClient operations, MultiLanguageBatchInputV2 multiLanguageBatchInputV2 = null, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <object> result = await operations.SentimentWithOperationResponseAsync(multiLanguageBatchInputV2, cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <summary> /// Get the status of an operation submitted for processing. If the the /// operation has reached a 'Succeeded' state, will also return the /// result. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='operationId'> /// Required. A unique id for the submitted operation. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <object> OperationStatusAsync(this ICustomerFinderCognitiveServicesClient operations, string operationId, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <object> result = await operations.OperationStatusWithOperationResponseAsync(operationId, cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <summary> /// The API returns the top detected topics for a list of submitted /// text documents. /// A topic is identified with a key phrase, which can be /// one or more related words. /// Use the URL parameters and stop word list to control /// which words or documents are filtered out. /// You can also supply a list of topics to exclude from /// the response. /// At least 100 text documents must be submitted, however /// it is designed to detect topics across hundreds to thousands of /// documents. /// Note that one transaction is charged per text document /// submitted. /// For best performance, limit each document to a short, /// human written text paragraph such as review, conversation or user /// feedback. /// </summary> /// <param name='operations'> /// Reference to the /// CustomerFinderCognitiveServices.ICustomerFinderCognitiveServicesClient. /// </param> /// <param name='minDocumentsPerWord'> /// Optional. Format - int32. (optional) Words that occur in less than /// this many documents are ignored. /// Use this parameter to help exclude rare document /// topics. /// Omit to let the service choose appropriate value. /// </param> /// <param name='maxDocumentsPerWord'> /// Optional. Format - int32. (optional) Words that occur in more than /// this many documents are ignored. /// Use this parameter to help exclude ubiquitous document /// topics. /// Omit to let the service choose appropriate value. /// </param> /// <param name='topicDetectionInputV2'> /// Optional. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <ErrorResponse> DetectTopicsAsync(this ICustomerFinderCognitiveServicesClient operations, int?minDocumentsPerWord = null, int?maxDocumentsPerWord = null, TopicDetectionInputV2 topicDetectionInputV2 = null, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <CustomerFinderCognitiveServices.Models.ErrorResponse> result = await operations.DetectTopicsWithOperationResponseAsync(minDocumentsPerWord, maxDocumentsPerWord, topicDetectionInputV2, cancellationToken).ConfigureAwait(false); return(result.Body); }