diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/BaseTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/BaseTests.cs index 308fd9c4dfe8..68c13a836d78 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/BaseTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/BaseTests.cs @@ -8,7 +8,7 @@ public abstract class BaseTests { public static bool IsTestTenant = false; // BaseEndpoint only contains protocol and hostname - private static string BaseEndpoint = "https://westus.api.cognitive.microsoft.com"; + private static string BaseEndpoint = "https://westcentralus.api.cognitive.microsoft.com"; private static string SubscriptionKey = "000"; protected ITextAnalyticsClient GetClient(DelegatingHandler handler) diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.DetectLanguageTests/DetectLanguage.json b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.DetectLanguageTests/DetectLanguage.json index 6b0070bcf3ac..bdcb893d066f 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.DetectLanguageTests/DetectLanguage.json +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.DetectLanguageTests/DetectLanguage.json @@ -1,8 +1,8 @@ { "Entries": [ { - "RequestUri": "/text/analytics/v2.1-preview/languages", - "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9sYW5ndWFnZXM=", + "RequestUri": "/text/analytics/v2.1/languages", + "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEvbGFuZ3VhZ2Vz", "RequestMethod": "POST", "RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"id\": \"id\",\r\n \"text\": \"I love my team mates\"\r\n }\r\n ]\r\n}", "RequestHeaders": { diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.EntitiesTests/Entities.json b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.EntitiesTests/Entities.json index 095fd5f4df86..4c64789d5cd9 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.EntitiesTests/Entities.json +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.EntitiesTests/Entities.json @@ -1,8 +1,8 @@ { "Entries": [ { - "RequestUri": "/text/analytics/v2.1-preview/entities", - "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9lbnRpdGllcw==", + "RequestUri": "/text/analytics/v2.1/entities", + "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEvZW50aXRpZXM=", "RequestMethod": "POST", "RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"language\": \"en\",\r\n \"id\": \"id\",\r\n \"text\": \"Microsoft released Windows 10\"\r\n }\r\n ]\r\n}", "RequestHeaders": { @@ -20,7 +20,7 @@ "Microsoft.CognitiveServices.Language.TextAnalytics.TextAnalyticsAPI/1.0.0" ] }, - "ResponseBody": "{ \"documents\": [{\"id\": \"1\", \"entities\": [ { \"name\": \"Windows 10\", \"matches\": [ { \"text\": \"Windows 10\", \"offset\": 19, \"length\": 10 } ], \"wikipediaLanguage\": \"en\", \"wikipediaId\": \"Windows 10\", \"wikipediaUrl\": \"https://en.wikipedia.org/wiki/Windows_10\", \"bingId\": \"5f9fbd03-49c4-39ef-cc95-de83ab897b94\" }, { \"name\": \"Microsoft\", \"matches\": [ { \"text\": \"Microsoft\", \"offset\": 0, \"length\": 9 } ], \"wikipediaLanguage\": \"en\", \"wikipediaId\": \"Microsoft\", \"wikipediaUrl\": \"https://en.wikipedia.org/wiki/Microsoft\", \"bingId\": \"a093e9b9-90f5-a3d5-c4b8-5855e1b01f85\" } ] }\r\n ],\r\n \"errors\": []\r\n}", + "ResponseBody": "{\"documents\":[{\"id\":\"id\",\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"wikipediaScore\":0.12508682244047509,\"entityTypeScore\":0.99999618530273438,\"text\":\"Microsoft\",\"offset\":0,\"length\":9}],\"wikipediaLanguage\":\"en\",\"wikipediaId\":\"Microsoft\",\"wikipediaUrl\":\"https://en.wikipedia.org/wiki/Microsoft\",\"bingId\":\"a093e9b9-90f5-a3d5-c4b8-5855e1b01f85\",\"type\":\"Organization\"},{\"name\":\"Windows 10\",\"matches\":[{\"wikipediaScore\":0.35750355694656766,\"text\":\"Windows 10\",\"offset\":19,\"length\":10}],\"wikipediaLanguage\":\"en\",\"wikipediaId\":\"Windows 10\",\"wikipediaUrl\":\"https://en.wikipedia.org/wiki/Windows_10\",\"bingId\":\"5f9fbd03-49c4-39ef-cc95-de83ab897b94\"}]}\r\n ],\r\n \"errors\":[]\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.KeyPhrasesTests/KeyPhrases.json b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.KeyPhrasesTests/KeyPhrases.json index 6e2b117ff322..4427ae2e56dc 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.KeyPhrasesTests/KeyPhrases.json +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.KeyPhrasesTests/KeyPhrases.json @@ -1,8 +1,8 @@ { "Entries": [ { - "RequestUri": "/text/analytics/v2.1-preview/keyPhrases", - "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9rZXlQaHJhc2Vz", + "RequestUri": "/text/analytics/v2.1/keyPhrases", + "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEva2V5UGhyYXNlcw==", "RequestMethod": "POST", "RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"language\": \"en\",\r\n \"id\": \"id\",\r\n \"text\": \"I love my team mates\"\r\n }\r\n ]\r\n}", "RequestHeaders": { diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.SentimentTests/Sentiment.json b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.SentimentTests/Sentiment.json index 0763200f6e6a..685c108482dd 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.SentimentTests/Sentiment.json +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/SessionRecords/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests.SentimentTests/Sentiment.json @@ -1,8 +1,8 @@ { "Entries": [ { - "RequestUri": "/text/analytics/v2.1-preview/sentiment", - "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEtcHJldmlldy9zZW50aW1lbnQ=", + "RequestUri": "/text/analytics/v2.1/sentiment", + "EncodedRequestUri": "L3RleHQvYW5hbHl0aWNzL3YyLjEvc2VudGltZW50", "RequestMethod": "POST", "RequestBody": "{\r\n \"documents\": [\r\n {\r\n \"language\": \"en\",\r\n \"id\": \"id\",\r\n \"text\": \"I love my team mates\"\r\n }\r\n ]\r\n}", "RequestHeaders": { diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/DetectLanguageTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/DetectLanguageTests.cs index bc8045d6108a..d37987fca1ab 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/DetectLanguageTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/DetectLanguageTests.cs @@ -21,10 +21,11 @@ public async Task DetectLanguage() HttpMockServer.Initialize(this.GetType().FullName, "DetectLanguage"); ITextAnalyticsClient client = GetClient(HttpMockServer.CreateInstance()); LanguageBatchResult result = await client.DetectLanguageAsync( - new BatchInput( - new List() + null, + new LanguageBatchInput( + new List() { - new Input("id","I love my team mates") + new LanguageInput("en","id","I love my team mates") })); Assert.Equal("English", result.Documents[0].DetectedLanguages[0].Name); diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/EntitiesTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/EntitiesTests.cs index bfa82a30db7d..52a27c7106fd 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/EntitiesTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/EntitiesTests.cs @@ -17,7 +17,8 @@ public async Task Entities() { HttpMockServer.Initialize(this.GetType().FullName, "Entities"); ITextAnalyticsClient client = GetClient(HttpMockServer.CreateInstance()); - EntitiesBatchResultV2dot1 result = await client.EntitiesAsync( + EntitiesBatchResult result = await client.EntitiesAsync( + null, new MultiLanguageBatchInput( new List() { @@ -29,8 +30,11 @@ public async Task Entities() } })); - Assert.Equal("Windows 10", result.Documents[0].Entities[0].Name); - Assert.Equal("5f9fbd03-49c4-39ef-cc95-de83ab897b94", result.Documents[0].Entities[0].BingId); + Assert.Equal("Microsoft", result.Documents[0].Entities[0].Name); + Assert.Equal("a093e9b9-90f5-a3d5-c4b8-5855e1b01f85", result.Documents[0].Entities[0].BingId); + Assert.Equal("Microsoft", result.Documents[0].Entities[0].Matches[0].Text); + Assert.Equal(0.12508682244047509, result.Documents[0].Entities[0].Matches[0].WikipediaScore); + Assert.Equal(0.99999618530273438, result.Documents[0].Entities[0].Matches[0].EntityTypeScore); context.Stop(); } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/KeyPhrasesTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/KeyPhrasesTests.cs index 061fd7f846fd..26350ca5f658 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/KeyPhrasesTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/KeyPhrasesTests.cs @@ -21,6 +21,7 @@ public async Task KeyPhrases() HttpMockServer.Initialize(this.GetType().FullName, "KeyPhrases"); ITextAnalyticsClient client = GetClient(HttpMockServer.CreateInstance()); KeyPhraseBatchResult result = await client.KeyPhrasesAsync( + null, new MultiLanguageBatchInput( new List() { diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/SentimentTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/SentimentTests.cs index 9a6a801d7774..96375f963051 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/SentimentTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics.Tests/TextAnalytics/SentimentTests.cs @@ -21,6 +21,7 @@ public async Task Sentiment() HttpMockServer.Initialize(this.GetType().FullName, "Sentiment"); ITextAnalyticsClient client = GetClient(HttpMockServer.CreateInstance()); SentimentBatchResult result = await client.SentimentAsync( + null, new MultiLanguageBatchInput( new List() { diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/ITextAnalyticsClient.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/ITextAnalyticsClient.cs index 79606f50bfed..8537ead28dbf 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/ITextAnalyticsClient.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/ITextAnalyticsClient.cs @@ -58,18 +58,19 @@ public partial interface ITextAnalyticsClient : System.IDisposable /// - /// The API returns a list of strings denoting the key talking points - /// in the input text. + /// The API returns the detected language and a numeric score between 0 + /// and 1. /// /// - /// See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text - /// Analytics Documentation</a> for details about the languages - /// that are supported by key phrase extraction. + /// Scores close to 1 indicate 100% certainty that the identified + /// language is true. A total of 120 languages are supported. /// - /// - /// Collection of documents to analyze. Documents can now contain a - /// language field to indicate the text language + /// + /// (optional) if set to true, response will contain input and document + /// level statistics. + /// + /// + /// Collection of documents to analyze. /// /// /// The headers that will be added to request. @@ -77,17 +78,24 @@ public partial interface ITextAnalyticsClient : System.IDisposable /// /// The cancellation token. /// - Task> KeyPhrasesWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DetectLanguageWithHttpMessagesAsync(bool? showStats = default(bool?), LanguageBatchInput languageBatchInput = default(LanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The API returns the detected language and a numeric score between 0 - /// and 1. + /// The API returns a list of recognized entities in a given document. /// /// - /// Scores close to 1 indicate 100% certainty that the identified - /// language is true. A total of 120 languages are supported. + /// To get even more information on each recognized entity we recommend + /// using the Bing Entity Search API by querying for the recognized + /// entities names. See the <a + /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported + /// languages in Text Analytics API</a> for the list of enabled + /// languages. /// - /// + /// + /// (optional) if set to true, response will contain input and document + /// level statistics. + /// + /// /// Collection of documents to analyze. /// /// @@ -96,21 +104,25 @@ public partial interface ITextAnalyticsClient : System.IDisposable /// /// The cancellation token. /// - Task> DetectLanguageWithHttpMessagesAsync(BatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> EntitiesWithHttpMessagesAsync(bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The API returns a numeric score between 0 and 1. + /// The API returns a list of strings denoting the key talking points + /// in the input text. /// /// - /// Scores close to 1 indicate positive sentiment, while scores close - /// to 0 indicate negative sentiment. A score of 0.5 indicates the lack - /// of sentiment (e.g. a factoid statement). See the <a + /// See the <a /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text /// Analytics Documentation</a> for details about the languages - /// that are supported by sentiment analysis. + /// that are supported by key phrase extraction. /// - /// - /// Collection of documents to analyze. + /// + /// (optional) if set to true, response will contain input and document + /// level statistics. + /// + /// + /// Collection of documents to analyze. Documents can now contain a + /// language field to indicate the text language /// /// /// The headers that will be added to request. @@ -118,34 +130,24 @@ public partial interface ITextAnalyticsClient : System.IDisposable /// /// The cancellation token. /// - Task> SentimentWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> KeyPhrasesWithHttpMessagesAsync(bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The API returns a list of recognized entities in a given document. + /// The API returns a numeric score between 0 and 1. /// /// - /// The API returns a list of recognized entities in a given document. - /// To get even more information on each recognized entity we recommend - /// using the Bing Entity Search API by querying for the recognized - /// entities names. See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported - /// languages in Text Analytics API</a> for the list of enabled - /// languages.The API returns a list of known entities and general - /// named entities ("Person", "Location", "Organization" etc) in a - /// given document. Known entities are returned with Wikipedia Id and - /// Wikipedia link, and also Bing Id which can be used in Bing Entity - /// Search API. General named entities are returned with entity types. - /// If a general named entity is also a known entity, then all - /// information regarding it (Wikipedia Id, Bing Id, entity type etc) - /// will be returned. See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking#supported-types-for-named-entity-recognition">Supported - /// Entity Types in Text Analytics API</a> for the list of - /// supported Entity Types. See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported - /// languages in Text Analytics API</a> for the list of enabled - /// languages. + /// Scores close to 1 indicate positive sentiment, while scores close + /// to 0 indicate negative sentiment. A score of 0.5 indicates the lack + /// of sentiment (e.g. a factoid statement). See the <a + /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text + /// Analytics Documentation</a> for details about the languages + /// that are supported by sentiment analysis. /// - /// + /// + /// (optional) if set to true, response will contain input and document + /// level statistics. + /// + /// /// Collection of documents to analyze. /// /// @@ -154,7 +156,7 @@ public partial interface ITextAnalyticsClient : System.IDisposable /// /// The cancellation token. /// - Task> EntitiesWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> SentimentWithHttpMessagesAsync(bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/DocumentStatistics.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/DocumentStatistics.cs new file mode 100644 index 000000000000..e0f645f14c67 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/DocumentStatistics.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class DocumentStatistics + { + /// + /// Initializes a new instance of the DocumentStatistics class. + /// + public DocumentStatistics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DocumentStatistics class. + /// + /// Number of text elements recognized in + /// the document. + /// Number of transactions for the + /// document. + public DocumentStatistics(int? charactersCount = default(int?), int? transactionsCount = default(int?)) + { + CharactersCount = charactersCount; + TransactionsCount = transactionsCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of text elements recognized in the document. + /// + [JsonProperty(PropertyName = "charactersCount")] + public int? CharactersCount { get; set; } + + /// + /// Gets or sets number of transactions for the document. + /// + [JsonProperty(PropertyName = "transactionsCount")] + public int? TransactionsCount { get; set; } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultV2dot1.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResult.cs similarity index 53% rename from src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultV2dot1.cs rename to src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResult.cs index 639e029d8776..cfb6a28a78b2 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultV2dot1.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResult.cs @@ -15,23 +15,29 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models using System.Collections.Generic; using System.Linq; - public partial class EntitiesBatchResultV2dot1 + public partial class EntitiesBatchResult { /// - /// Initializes a new instance of the EntitiesBatchResultV2dot1 class. + /// Initializes a new instance of the EntitiesBatchResult class. /// - public EntitiesBatchResultV2dot1() + public EntitiesBatchResult() { CustomInit(); } /// - /// Initializes a new instance of the EntitiesBatchResultV2dot1 class. + /// Initializes a new instance of the EntitiesBatchResult class. /// - public EntitiesBatchResultV2dot1(IList documents = default(IList), IList errors = default(IList)) + /// Response by document + /// Errors and Warnings by document + /// (Optional) if showStats=true was specified + /// in the request this field will contain information about the + /// request payload. + public EntitiesBatchResult(IList documents = default(IList), IList errors = default(IList), RequestStatistics statistics = default(RequestStatistics)) { Documents = documents; Errors = errors; + Statistics = statistics; CustomInit(); } @@ -41,14 +47,23 @@ public EntitiesBatchResultV2dot1() partial void CustomInit(); /// + /// Gets response by document /// [JsonProperty(PropertyName = "documents")] - public IList Documents { get; private set; } + public IList Documents { get; private set; } /// + /// Gets errors and Warnings by document /// [JsonProperty(PropertyName = "errors")] public IList Errors { get; private set; } + /// + /// Gets (Optional) if showStats=true was specified in the request this + /// field will contain information about the request payload. + /// + [JsonProperty(PropertyName = "statistics")] + public RequestStatistics Statistics { get; private set; } + } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultItemV2dot1.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultItem.cs similarity index 56% rename from src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultItemV2dot1.cs rename to src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultItem.cs index 08ad428c74d3..bb02db2e5c86 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultItemV2dot1.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntitiesBatchResultItem.cs @@ -15,27 +15,29 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models using System.Collections.Generic; using System.Linq; - public partial class EntitiesBatchResultItemV2dot1 + public partial class EntitiesBatchResultItem { /// - /// Initializes a new instance of the EntitiesBatchResultItemV2dot1 - /// class. + /// Initializes a new instance of the EntitiesBatchResultItem class. /// - public EntitiesBatchResultItemV2dot1() + public EntitiesBatchResultItem() { CustomInit(); } /// - /// Initializes a new instance of the EntitiesBatchResultItemV2dot1 - /// class. + /// Initializes a new instance of the EntitiesBatchResultItem class. /// - /// Unique document identifier. + /// Unique, non-empty document identifier. /// Recognized entities in the document. - public EntitiesBatchResultItemV2dot1(string id = default(string), IList entities = default(IList)) + /// (Optional) if showStats=true was specified + /// in the request this field will contain information about the + /// document payload. + public EntitiesBatchResultItem(string id = default(string), IList entities = default(IList), DocumentStatistics statistics = default(DocumentStatistics)) { Id = id; Entities = entities; + Statistics = statistics; CustomInit(); } @@ -45,16 +47,24 @@ public EntitiesBatchResultItemV2dot1() partial void CustomInit(); /// - /// Gets unique document identifier. + /// Gets or sets unique, non-empty document identifier. /// [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + public string Id { get; set; } /// /// Gets recognized entities in the document. /// [JsonProperty(PropertyName = "entities")] - public IList Entities { get; private set; } + public IList Entities { get; private set; } + + /// + /// Gets or sets (Optional) if showStats=true was specified in the + /// request this field will contain information about the document + /// payload. + /// + [JsonProperty(PropertyName = "statistics")] + public DocumentStatistics Statistics { get; set; } } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntityRecordV2dot1.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntityRecord.cs similarity index 82% rename from src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntityRecordV2dot1.cs rename to src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntityRecord.cs index aed5b02a33f0..88b0e1e373cc 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntityRecordV2dot1.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/EntityRecord.cs @@ -15,18 +15,18 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models using System.Collections.Generic; using System.Linq; - public partial class EntityRecordV2dot1 + public partial class EntityRecord { /// - /// Initializes a new instance of the EntityRecordV2dot1 class. + /// Initializes a new instance of the EntityRecord class. /// - public EntityRecordV2dot1() + public EntityRecord() { CustomInit(); } /// - /// Initializes a new instance of the EntityRecordV2dot1 class. + /// Initializes a new instance of the EntityRecord class. /// /// Entity formal name. /// List of instances this entity appears in the @@ -35,7 +35,7 @@ public EntityRecordV2dot1() /// WikipediaId and WikipediaUrl refers to. /// Wikipedia unique identifier of the /// recognized entity. - /// URL for the entity's English Wikipedia + /// URL for the entity's Wikipedia /// page. /// Bing unique identifier of the recognized /// entity. Use in conjunction with the Bing Entity Search API to fetch @@ -44,7 +44,7 @@ public EntityRecordV2dot1() /// model /// Entity sub type from Named Entity Recognition /// model - public EntityRecordV2dot1(string name = default(string), IList matches = default(IList), string wikipediaLanguage = default(string), string wikipediaId = default(string), string wikipediaUrl = default(string), string bingId = default(string), string type = default(string), string subType = default(string)) + public EntityRecord(string name = default(string), IList matches = default(IList), string wikipediaLanguage = default(string), string wikipediaId = default(string), string wikipediaUrl = default(string), string bingId = default(string), string type = default(string), string subType = default(string)) { Name = name; Matches = matches; @@ -72,7 +72,7 @@ public EntityRecordV2dot1() /// Gets or sets list of instances this entity appears in the text. /// [JsonProperty(PropertyName = "matches")] - public IList Matches { get; set; } + public IList Matches { get; set; } /// /// Gets or sets wikipedia language for which the WikipediaId and @@ -88,7 +88,7 @@ public EntityRecordV2dot1() public string WikipediaId { get; set; } /// - /// Gets URL for the entity's English Wikipedia page. + /// Gets URL for the entity's Wikipedia page. /// [JsonProperty(PropertyName = "wikipediaUrl")] public string WikipediaUrl { get; private set; } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResult.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResult.cs index 663f914d9616..4301dfe52b91 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResult.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResult.cs @@ -28,10 +28,16 @@ public KeyPhraseBatchResult() /// /// Initializes a new instance of the KeyPhraseBatchResult class. /// - public KeyPhraseBatchResult(IList documents = default(IList), IList errors = default(IList)) + /// Response by document + /// Errors and Warnings by document + /// =(Optional) if showStats=true was + /// specified in the request this field will contain information about + /// the request payload. + public KeyPhraseBatchResult(IList documents = default(IList), IList errors = default(IList), RequestStatistics statistics = default(RequestStatistics)) { Documents = documents; Errors = errors; + Statistics = statistics; CustomInit(); } @@ -41,14 +47,23 @@ public KeyPhraseBatchResult() partial void CustomInit(); /// + /// Gets response by document /// [JsonProperty(PropertyName = "documents")] public IList Documents { get; private set; } /// + /// Gets errors and Warnings by document /// [JsonProperty(PropertyName = "errors")] public IList Errors { get; private set; } + /// + /// Gets =(Optional) if showStats=true was specified in the request + /// this field will contain information about the request payload. + /// + [JsonProperty(PropertyName = "statistics")] + public RequestStatistics Statistics { get; private set; } + } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResultItem.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResultItem.cs index 4402ee0ff877..f8270b6d9b71 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResultItem.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/KeyPhraseBatchResultItem.cs @@ -28,14 +28,18 @@ public KeyPhraseBatchResultItem() /// /// Initializes a new instance of the KeyPhraseBatchResultItem class. /// + /// Unique, non-empty document identifier. /// A list of representative words or phrases. /// The number of key phrases returned is proportional to the number of /// words in the input document. - /// Unique document identifier. - public KeyPhraseBatchResultItem(IList keyPhrases = default(IList), string id = default(string)) + /// (Optional) if showStats=true was specified + /// in the request this field will contain information about the + /// document payload. + public KeyPhraseBatchResultItem(string id = default(string), IList keyPhrases = default(IList), DocumentStatistics statistics = default(DocumentStatistics)) { - KeyPhrases = keyPhrases; Id = id; + KeyPhrases = keyPhrases; + Statistics = statistics; CustomInit(); } @@ -44,6 +48,12 @@ public KeyPhraseBatchResultItem() /// partial void CustomInit(); + /// + /// Gets or sets unique, non-empty document identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + /// /// Gets a list of representative words or phrases. The number of key /// phrases returned is proportional to the number of words in the @@ -53,10 +63,12 @@ public KeyPhraseBatchResultItem() public IList KeyPhrases { get; private set; } /// - /// Gets unique document identifier. + /// Gets or sets (Optional) if showStats=true was specified in the + /// request this field will contain information about the document + /// payload. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [JsonProperty(PropertyName = "statistics")] + public DocumentStatistics Statistics { get; set; } } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/BatchInput.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchInput.cs similarity index 73% rename from src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/BatchInput.cs rename to src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchInput.cs index 3b099904d68a..57651bdba46f 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/BatchInput.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchInput.cs @@ -15,20 +15,20 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models using System.Collections.Generic; using System.Linq; - public partial class BatchInput + public partial class LanguageBatchInput { /// - /// Initializes a new instance of the BatchInput class. + /// Initializes a new instance of the LanguageBatchInput class. /// - public BatchInput() + public LanguageBatchInput() { CustomInit(); } /// - /// Initializes a new instance of the BatchInput class. + /// Initializes a new instance of the LanguageBatchInput class. /// - public BatchInput(IList documents = default(IList)) + public LanguageBatchInput(IList documents = default(IList)) { Documents = documents; CustomInit(); @@ -42,7 +42,7 @@ public BatchInput() /// /// [JsonProperty(PropertyName = "documents")] - public IList Documents { get; set; } + public IList Documents { get; set; } } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResult.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResult.cs index e28681181736..47fadb520e64 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResult.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResult.cs @@ -28,10 +28,16 @@ public LanguageBatchResult() /// /// Initializes a new instance of the LanguageBatchResult class. /// - public LanguageBatchResult(IList documents = default(IList), IList errors = default(IList)) + /// Response by document + /// Errors and Warnings by document + /// (Optional) if showStats=true was specified + /// in the request this field will contain information about the + /// request payload. + public LanguageBatchResult(IList documents = default(IList), IList errors = default(IList), RequestStatistics statistics = default(RequestStatistics)) { Documents = documents; Errors = errors; + Statistics = statistics; CustomInit(); } @@ -41,14 +47,23 @@ public LanguageBatchResult() partial void CustomInit(); /// + /// Gets response by document /// [JsonProperty(PropertyName = "documents")] public IList Documents { get; private set; } /// + /// Gets errors and Warnings by document /// [JsonProperty(PropertyName = "errors")] public IList Errors { get; private set; } + /// + /// Gets (Optional) if showStats=true was specified in the request this + /// field will contain information about the request payload. + /// + [JsonProperty(PropertyName = "statistics")] + public RequestStatistics Statistics { get; private set; } + } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResultItem.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResultItem.cs index 47beaf5afe4a..e2300c84fb1b 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResultItem.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageBatchResultItem.cs @@ -28,13 +28,17 @@ public LanguageBatchResultItem() /// /// Initializes a new instance of the LanguageBatchResultItem class. /// - /// Unique document identifier. + /// Unique, non-empty document identifier. /// A list of extracted /// languages. - public LanguageBatchResultItem(string id = default(string), IList detectedLanguages = default(IList)) + /// (Optional) if showStats=true was specified + /// in the request this field will contain information about the + /// document payload. + public LanguageBatchResultItem(string id = default(string), IList detectedLanguages = default(IList), DocumentStatistics statistics = default(DocumentStatistics)) { Id = id; DetectedLanguages = detectedLanguages; + Statistics = statistics; CustomInit(); } @@ -44,16 +48,24 @@ public LanguageBatchResultItem() partial void CustomInit(); /// - /// Gets unique document identifier. + /// Gets or sets unique, non-empty document identifier. /// [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + public string Id { get; set; } /// - /// Gets a list of extracted languages. + /// Gets or sets a list of extracted languages. /// [JsonProperty(PropertyName = "detectedLanguages")] - public IList DetectedLanguages { get; private set; } + public IList DetectedLanguages { get; set; } + + /// + /// Gets or sets (Optional) if showStats=true was specified in the + /// request this field will contain information about the document + /// payload. + /// + [JsonProperty(PropertyName = "statistics")] + public DocumentStatistics Statistics { get; set; } } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/Input.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageInput.cs similarity index 71% rename from src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/Input.cs rename to src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageInput.cs index a73c34d36d57..d8ff5b429f40 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/Input.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/LanguageInput.cs @@ -13,22 +13,23 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models using Newtonsoft.Json; using System.Linq; - public partial class Input + public partial class LanguageInput { /// - /// Initializes a new instance of the Input class. + /// Initializes a new instance of the LanguageInput class. /// - public Input() + public LanguageInput() { CustomInit(); } /// - /// Initializes a new instance of the Input class. + /// Initializes a new instance of the LanguageInput class. /// /// Unique, non-empty document identifier. - public Input(string id = default(string), string text = default(string)) + public LanguageInput(string countryHint = default(string), string id = default(string), string text = default(string)) { + CountryHint = countryHint; Id = id; Text = text; CustomInit(); @@ -39,6 +40,11 @@ public Input() /// partial void CustomInit(); + /// + /// + [JsonProperty(PropertyName = "countryHint")] + public string CountryHint { get; set; } + /// /// Gets or sets unique, non-empty document identifier. /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/MatchRecordV2dot1.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/MatchRecord.cs similarity index 54% rename from src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/MatchRecordV2dot1.cs rename to src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/MatchRecord.cs index 09b8042ec446..114279165f8e 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/MatchRecordV2dot1.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/MatchRecord.cs @@ -13,26 +13,34 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models using Newtonsoft.Json; using System.Linq; - public partial class MatchRecordV2dot1 + public partial class MatchRecord { /// - /// Initializes a new instance of the MatchRecordV2dot1 class. + /// Initializes a new instance of the MatchRecord class. /// - public MatchRecordV2dot1() + public MatchRecord() { CustomInit(); } /// - /// Initializes a new instance of the MatchRecordV2dot1 class. + /// Initializes a new instance of the MatchRecord class. /// + /// (optional) If a well-known item with + /// Wikipedia link is recognized, a decimal number denoting the + /// confidence level of the Wikipedia info will be returned. + /// (optional) If an entity type is + /// recognized, a decimal number denoting the confidence level of the + /// entity type will be returned. /// Entity text as appears in the request. /// Start position (in Unicode characters) for the /// entity match text. /// Length (in Unicode characters) for the entity /// match text. - public MatchRecordV2dot1(string text = default(string), int? offset = default(int?), int? length = default(int?)) + public MatchRecord(double? wikipediaScore = default(double?), double? entityTypeScore = default(double?), string text = default(string), int? offset = default(int?), int? length = default(int?)) { + WikipediaScore = wikipediaScore; + EntityTypeScore = entityTypeScore; Text = text; Offset = offset; Length = length; @@ -44,6 +52,22 @@ public MatchRecordV2dot1() /// partial void CustomInit(); + /// + /// Gets or sets (optional) If a well-known item with Wikipedia link is + /// recognized, a decimal number denoting the confidence level of the + /// Wikipedia info will be returned. + /// + [JsonProperty(PropertyName = "wikipediaScore")] + public double? WikipediaScore { get; set; } + + /// + /// Gets or sets (optional) If an entity type is recognized, a decimal + /// number denoting the confidence level of the entity type will be + /// returned. + /// + [JsonProperty(PropertyName = "entityTypeScore")] + public double? EntityTypeScore { get; set; } + /// /// Gets or sets entity text as appears in the request. /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/RequestStatistics.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/RequestStatistics.cs new file mode 100644 index 000000000000..417262f53eac --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/RequestStatistics.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class RequestStatistics + { + /// + /// Initializes a new instance of the RequestStatistics class. + /// + public RequestStatistics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RequestStatistics class. + /// + /// Number of documents submitted in the + /// request. + /// Number of valid documents. This + /// excludes empty, over-size limit or non-supported languages + /// documents. + /// Number of invalid documents. + /// This includes empty, over-size limit or non-supported languages + /// documents. + /// Number of transactions for the + /// request. + public RequestStatistics(int? documentsCount = default(int?), int? validDocumentsCount = default(int?), int? erroneousDocumentsCount = default(int?), long? transactionsCount = default(long?)) + { + DocumentsCount = documentsCount; + ValidDocumentsCount = validDocumentsCount; + ErroneousDocumentsCount = erroneousDocumentsCount; + TransactionsCount = transactionsCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of documents submitted in the request. + /// + [JsonProperty(PropertyName = "documentsCount")] + public int? DocumentsCount { get; set; } + + /// + /// Gets or sets number of valid documents. This excludes empty, + /// over-size limit or non-supported languages documents. + /// + [JsonProperty(PropertyName = "validDocumentsCount")] + public int? ValidDocumentsCount { get; set; } + + /// + /// Gets or sets number of invalid documents. This includes empty, + /// over-size limit or non-supported languages documents. + /// + [JsonProperty(PropertyName = "erroneousDocumentsCount")] + public int? ErroneousDocumentsCount { get; set; } + + /// + /// Gets or sets number of transactions for the request. + /// + [JsonProperty(PropertyName = "transactionsCount")] + public long? TransactionsCount { get; set; } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResult.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResult.cs index 1b66e1cdbd4d..ea63d8a55d73 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResult.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResult.cs @@ -28,10 +28,16 @@ public SentimentBatchResult() /// /// Initializes a new instance of the SentimentBatchResult class. /// - public SentimentBatchResult(IList documents = default(IList), IList errors = default(IList)) + /// Response by document + /// Errors and Warnings by document + /// (Optional) if showStats=true was specified + /// in the request this field will contain information about the + /// request payload. + public SentimentBatchResult(IList documents = default(IList), IList errors = default(IList), RequestStatistics statistics = default(RequestStatistics)) { Documents = documents; Errors = errors; + Statistics = statistics; CustomInit(); } @@ -41,14 +47,23 @@ public SentimentBatchResult() partial void CustomInit(); /// + /// Gets response by document /// [JsonProperty(PropertyName = "documents")] public IList Documents { get; private set; } /// + /// Gets errors and Warnings by document /// [JsonProperty(PropertyName = "errors")] public IList Errors { get; private set; } + /// + /// Gets (Optional) if showStats=true was specified in the request this + /// field will contain information about the request payload. + /// + [JsonProperty(PropertyName = "statistics")] + public RequestStatistics Statistics { get; private set; } + } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResultItem.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResultItem.cs index 595709a09c33..36de9df8818e 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResultItem.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/Models/SentimentBatchResultItem.cs @@ -26,15 +26,19 @@ public SentimentBatchResultItem() /// /// Initializes a new instance of the SentimentBatchResultItem class. /// + /// Unique, non-empty document identifier. /// A decimal number between 0 and 1 denoting the /// sentiment of the document. A score above 0.7 usually refers to a /// positive document while a score below 0.3 normally has a negative /// connotation. Mid values refer to neutral text. - /// Unique document identifier. - public SentimentBatchResultItem(double? score = default(double?), string id = default(string)) + /// (Optional) if showStats=true was specified + /// in the request this field will contain information about the + /// document payload. + public SentimentBatchResultItem(string id = default(string), double? score = default(double?), DocumentStatistics statistics = default(DocumentStatistics)) { - Score = score; Id = id; + Score = score; + Statistics = statistics; CustomInit(); } @@ -44,19 +48,27 @@ public SentimentBatchResultItem() partial void CustomInit(); /// - /// Gets a decimal number between 0 and 1 denoting the sentiment of the - /// document. A score above 0.7 usually refers to a positive document - /// while a score below 0.3 normally has a negative connotation. Mid - /// values refer to neutral text. + /// Gets or sets unique, non-empty document identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a decimal number between 0 and 1 denoting the + /// sentiment of the document. A score above 0.7 usually refers to a + /// positive document while a score below 0.3 normally has a negative + /// connotation. Mid values refer to neutral text. /// [JsonProperty(PropertyName = "score")] - public double? Score { get; private set; } + public double? Score { get; set; } /// - /// Gets unique document identifier. + /// Gets or sets (Optional) if showStats=true was specified in the + /// request this field will contain information about the document + /// payload. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [JsonProperty(PropertyName = "statistics")] + public DocumentStatistics Statistics { get; set; } } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/SdkInfo_TextAnalyticsClient.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/SdkInfo_TextAnalyticsClient.cs index 71cd990dc494..175dabeff468 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/SdkInfo_TextAnalyticsClient.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/SdkInfo_TextAnalyticsClient.cs @@ -19,10 +19,10 @@ public static IEnumerable> ApiInfo_TextAnalyticsCl { return new Tuple[] { - new Tuple("TextAnalyticsClient", "Detect Language", "v2.1-preview"), - new Tuple("TextAnalyticsClient", "Entities", "v2.1-preview"), - new Tuple("TextAnalyticsClient", "Key Phrases", "v2.1-preview"), - new Tuple("TextAnalyticsClient", "Sentiment", "v2.1-preview"), + new Tuple("TextAnalyticsClient", "Detect Language", "v2.1"), + new Tuple("TextAnalyticsClient", "Entities", "v2.1"), + new Tuple("TextAnalyticsClient", "Key Phrases", "v2.1"), + new Tuple("TextAnalyticsClient", "Sentiment", "v2.1"), }.AsEnumerable(); } } @@ -32,7 +32,7 @@ public static IEnumerable> ApiInfo_TextAnalyticsCl public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/TextAnalytics/readme.md --csharp --version=latest --reflect-api-versions --tag=release_2_1 --csharp.output-folder=C:\\mygitrepo\\azure-sdk-for-net\\src\\SDKs\\CognitiveServices\\dataPlane\\Language\\TextAnalytics\\TextAnalytics\\Generated\\TextAnalytics"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "9c1fe12b46cd05f44ed40a9e4bc25205cc343667"; + public static readonly String GithubCommidId = "a628a430e380b12082995b0882ac08bc457dc5fe"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClient.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClient.cs index e74e7c0d7e2f..2a7650e70df1 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClient.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClient.cs @@ -186,7 +186,7 @@ public TextAnalyticsClient(ServiceClientCredentials credentials, HttpClientHandl /// private void Initialize() { - BaseUri = "{Endpoint}/text/analytics/v2.1-preview"; + BaseUri = "{Endpoint}/text/analytics/v2.1"; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, @@ -215,18 +215,18 @@ private void Initialize() CustomInitialize(); } /// - /// The API returns a list of strings denoting the key talking points in the - /// input text. + /// The API returns the detected language and a numeric score between 0 and 1. /// /// - /// See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text - /// Analytics Documentation</a> for details about the languages that are - /// supported by key phrase extraction. + /// Scores close to 1 indicate 100% certainty that the identified language is + /// true. A total of 120 languages are supported. /// - /// - /// Collection of documents to analyze. Documents can now contain a language - /// field to indicate the text language + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// + /// Collection of documents to analyze. /// /// /// Headers that will be added to request. @@ -249,16 +249,12 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> KeyPhrasesWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DetectLanguageWithHttpMessagesAsync(bool? showStats = default(bool?), LanguageBatchInput languageBatchInput = default(LanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Endpoint == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Endpoint"); } - if (input == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "input"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -266,14 +262,24 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("input", input); + tracingParameters.Add("showStats", showStats); + tracingParameters.Add("languageBatchInput", languageBatchInput); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "KeyPhrases", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DetectLanguage", tracingParameters); } // Construct URL var _baseUrl = BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "keyPhrases"; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "languages"; _url = _url.Replace("{Endpoint}", Endpoint); + List _queryParameters = new List(); + if (showStats != null) + { + _queryParameters.Add(string.Format("showStats={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(showStats, SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; @@ -296,9 +302,9 @@ private void Initialize() // Serialize Request string _requestContent = null; - if(input != null) + if(languageBatchInput != null) { - _requestContent = SafeJsonConvert.SerializeObject(input, SerializationSettings); + _requestContent = SafeJsonConvert.SerializeObject(languageBatchInput, SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -352,7 +358,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new HttpOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; // Deserialize Response @@ -361,7 +367,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } catch (JsonException ex) { @@ -381,13 +387,21 @@ private void Initialize() } /// - /// The API returns the detected language and a numeric score between 0 and 1. + /// The API returns a list of recognized entities in a given document. /// /// - /// Scores close to 1 indicate 100% certainty that the identified language is - /// true. A total of 120 languages are supported. + /// To get even more information on each recognized entity we recommend using + /// the Bing Entity Search API by querying for the recognized entities names. + /// See the <a + /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported + /// languages in Text Analytics API</a> for the list of enabled + /// languages. /// - /// + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// /// Collection of documents to analyze. /// /// @@ -411,16 +425,12 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> DetectLanguageWithHttpMessagesAsync(BatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> EntitiesWithHttpMessagesAsync(bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Endpoint == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Endpoint"); } - if (input == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "input"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -428,14 +438,24 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("input", input); + tracingParameters.Add("showStats", showStats); + tracingParameters.Add("multiLanguageBatchInput", multiLanguageBatchInput); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DetectLanguage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Entities", tracingParameters); } // Construct URL var _baseUrl = BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "languages"; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "entities"; _url = _url.Replace("{Endpoint}", Endpoint); + List _queryParameters = new List(); + if (showStats != null) + { + _queryParameters.Add(string.Format("showStats={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(showStats, SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; @@ -458,9 +478,9 @@ private void Initialize() // Serialize Request string _requestContent = null; - if(input != null) + if(multiLanguageBatchInput != null) { - _requestContent = SafeJsonConvert.SerializeObject(input, SerializationSettings); + _requestContent = SafeJsonConvert.SerializeObject(multiLanguageBatchInput, SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -514,7 +534,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new HttpOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; // Deserialize Response @@ -523,7 +543,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } catch (JsonException ex) { @@ -543,18 +563,22 @@ private void Initialize() } /// - /// The API returns a numeric score between 0 and 1. + /// The API returns a list of strings denoting the key talking points in the + /// input text. /// /// - /// Scores close to 1 indicate positive sentiment, while scores close to 0 - /// indicate negative sentiment. A score of 0.5 indicates the lack of sentiment - /// (e.g. a factoid statement). See the <a + /// See the <a /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text /// Analytics Documentation</a> for details about the languages that are - /// supported by sentiment analysis. + /// supported by key phrase extraction. /// - /// - /// Collection of documents to analyze. + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// + /// Collection of documents to analyze. Documents can now contain a language + /// field to indicate the text language /// /// /// Headers that will be added to request. @@ -577,16 +601,12 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> SentimentWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> KeyPhrasesWithHttpMessagesAsync(bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Endpoint == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Endpoint"); } - if (input == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "input"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -594,14 +614,24 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("input", input); + tracingParameters.Add("showStats", showStats); + tracingParameters.Add("multiLanguageBatchInput", multiLanguageBatchInput); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Sentiment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "KeyPhrases", tracingParameters); } // Construct URL var _baseUrl = BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "sentiment"; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "keyPhrases"; _url = _url.Replace("{Endpoint}", Endpoint); + List _queryParameters = new List(); + if (showStats != null) + { + _queryParameters.Add(string.Format("showStats={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(showStats, SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; @@ -624,9 +654,9 @@ private void Initialize() // Serialize Request string _requestContent = null; - if(input != null) + if(multiLanguageBatchInput != null) { - _requestContent = SafeJsonConvert.SerializeObject(input, SerializationSettings); + _requestContent = SafeJsonConvert.SerializeObject(multiLanguageBatchInput, SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -680,7 +710,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new HttpOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; // Deserialize Response @@ -689,7 +719,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } catch (JsonException ex) { @@ -709,30 +739,21 @@ private void Initialize() } /// - /// The API returns a list of recognized entities in a given document. + /// The API returns a numeric score between 0 and 1. /// /// - /// The API returns a list of recognized entities in a given document. To get - /// even more information on each recognized entity we recommend using the Bing - /// Entity Search API by querying for the recognized entities names. See the - /// <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported - /// languages in Text Analytics API</a> for the list of enabled - /// languages.The API returns a list of known entities and general named - /// entities ("Person", "Location", "Organization" etc) in a given document. - /// Known entities are returned with Wikipedia Id and Wikipedia link, and also - /// Bing Id which can be used in Bing Entity Search API. General named entities - /// are returned with entity types. If a general named entity is also a known - /// entity, then all information regarding it (Wikipedia Id, Bing Id, entity - /// type etc) will be returned. See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking#supported-types-for-named-entity-recognition">Supported - /// Entity Types in Text Analytics API</a> for the list of supported - /// Entity Types. See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported - /// languages in Text Analytics API</a> for the list of enabled - /// languages. + /// Scores close to 1 indicate positive sentiment, while scores close to 0 + /// indicate negative sentiment. A score of 0.5 indicates the lack of sentiment + /// (e.g. a factoid statement). See the <a + /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text + /// Analytics Documentation</a> for details about the languages that are + /// supported by sentiment analysis. /// - /// + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// /// Collection of documents to analyze. /// /// @@ -741,7 +762,7 @@ private void Initialize() /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -756,16 +777,12 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> EntitiesWithHttpMessagesAsync(MultiLanguageBatchInput input, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> SentimentWithHttpMessagesAsync(bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Endpoint == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Endpoint"); } - if (input == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "input"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -773,14 +790,24 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("input", input); + tracingParameters.Add("showStats", showStats); + tracingParameters.Add("multiLanguageBatchInput", multiLanguageBatchInput); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Entities", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Sentiment", tracingParameters); } // Construct URL var _baseUrl = BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "entities"; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "sentiment"; _url = _url.Replace("{Endpoint}", Endpoint); + List _queryParameters = new List(); + if (showStats != null) + { + _queryParameters.Add(string.Format("showStats={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(showStats, SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; @@ -803,9 +830,9 @@ private void Initialize() // Serialize Request string _requestContent = null; - if(input != null) + if(multiLanguageBatchInput != null) { - _requestContent = SafeJsonConvert.SerializeObject(input, SerializationSettings); + _requestContent = SafeJsonConvert.SerializeObject(multiLanguageBatchInput, SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -859,7 +886,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new HttpOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; // Deserialize Response @@ -868,7 +895,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClientExtensions.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClientExtensions.cs index 1415f6b4b77d..f663e95ed6bd 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClientExtensions.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Generated/TextAnalytics/TextAnalyticsClientExtensions.cs @@ -20,121 +20,124 @@ namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics public static partial class TextAnalyticsClientExtensions { /// - /// The API returns a list of strings denoting the key talking points in the - /// input text. + /// The API returns the detected language and a numeric score between 0 and 1. /// /// - /// See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text - /// Analytics Documentation</a> for details about the languages that are - /// supported by key phrase extraction. + /// Scores close to 1 indicate 100% certainty that the identified language is + /// true. A total of 120 languages are supported. /// /// /// The operations group for this extension method. /// - /// - /// Collection of documents to analyze. Documents can now contain a language - /// field to indicate the text language + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// + /// Collection of documents to analyze. /// /// /// The cancellation token. /// - public static async Task KeyPhrasesAsync(this ITextAnalyticsClient operations, MultiLanguageBatchInput input, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DetectLanguageAsync(this ITextAnalyticsClient operations, bool? showStats = default(bool?), LanguageBatchInput languageBatchInput = default(LanguageBatchInput), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.KeyPhrasesWithHttpMessagesAsync(input, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DetectLanguageWithHttpMessagesAsync(showStats, languageBatchInput, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The API returns the detected language and a numeric score between 0 and 1. + /// The API returns a list of recognized entities in a given document. /// /// - /// Scores close to 1 indicate 100% certainty that the identified language is - /// true. A total of 120 languages are supported. + /// To get even more information on each recognized entity we recommend using + /// the Bing Entity Search API by querying for the recognized entities names. + /// See the <a + /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported + /// languages in Text Analytics API</a> for the list of enabled + /// languages. /// /// /// The operations group for this extension method. /// - /// + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// /// Collection of documents to analyze. /// /// /// The cancellation token. /// - public static async Task DetectLanguageAsync(this ITextAnalyticsClient operations, BatchInput input, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task EntitiesAsync(this ITextAnalyticsClient operations, bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DetectLanguageWithHttpMessagesAsync(input, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.EntitiesWithHttpMessagesAsync(showStats, multiLanguageBatchInput, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The API returns a numeric score between 0 and 1. + /// The API returns a list of strings denoting the key talking points in the + /// input text. /// /// - /// Scores close to 1 indicate positive sentiment, while scores close to 0 - /// indicate negative sentiment. A score of 0.5 indicates the lack of sentiment - /// (e.g. a factoid statement). See the <a + /// See the <a /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text /// Analytics Documentation</a> for details about the languages that are - /// supported by sentiment analysis. + /// supported by key phrase extraction. /// /// /// The operations group for this extension method. /// - /// - /// Collection of documents to analyze. + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// + /// Collection of documents to analyze. Documents can now contain a language + /// field to indicate the text language /// /// /// The cancellation token. /// - public static async Task SentimentAsync(this ITextAnalyticsClient operations, MultiLanguageBatchInput input, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task KeyPhrasesAsync(this ITextAnalyticsClient operations, bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.SentimentWithHttpMessagesAsync(input, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.KeyPhrasesWithHttpMessagesAsync(showStats, multiLanguageBatchInput, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The API returns a list of recognized entities in a given document. + /// The API returns a numeric score between 0 and 1. /// /// - /// The API returns a list of recognized entities in a given document. To get - /// even more information on each recognized entity we recommend using the Bing - /// Entity Search API by querying for the recognized entities names. See the - /// <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported - /// languages in Text Analytics API</a> for the list of enabled - /// languages.The API returns a list of known entities and general named - /// entities ("Person", "Location", "Organization" etc) in a given document. - /// Known entities are returned with Wikipedia Id and Wikipedia link, and also - /// Bing Id which can be used in Bing Entity Search API. General named entities - /// are returned with entity types. If a general named entity is also a known - /// entity, then all information regarding it (Wikipedia Id, Bing Id, entity - /// type etc) will be returned. See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking#supported-types-for-named-entity-recognition">Supported - /// Entity Types in Text Analytics API</a> for the list of supported - /// Entity Types. See the <a - /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages">Supported - /// languages in Text Analytics API</a> for the list of enabled - /// languages. + /// Scores close to 1 indicate positive sentiment, while scores close to 0 + /// indicate negative sentiment. A score of 0.5 indicates the lack of sentiment + /// (e.g. a factoid statement). See the <a + /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages">Text + /// Analytics Documentation</a> for details about the languages that are + /// supported by sentiment analysis. /// /// /// The operations group for this extension method. /// - /// + /// + /// (optional) if set to true, response will contain input and document level + /// statistics. + /// + /// /// Collection of documents to analyze. /// /// /// The cancellation token. /// - public static async Task EntitiesAsync(this ITextAnalyticsClient operations, MultiLanguageBatchInput input, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task SentimentAsync(this ITextAnalyticsClient operations, bool? showStats = default(bool?), MultiLanguageBatchInput multiLanguageBatchInput = default(MultiLanguageBatchInput), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.EntitiesWithHttpMessagesAsync(input, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.SentimentWithHttpMessagesAsync(showStats, multiLanguageBatchInput, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.csproj b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.csproj index d8278402f833..51b6f561c337 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.csproj +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Microsoft.Azure.CognitiveServices.Language.TextAnalytics.csproj @@ -6,17 +6,17 @@ Microsoft.Azure.CognitiveServices.Language.TextAnalytics This client library provides access to the Microsoft Cognitive Services Language APIs. - 2.8.0-preview + 3.0.0 Microsoft.Azure.CognitiveServices.Language.TextAnalytics Microsoft Cognitive Services;Cognitive Services;Cognitive Services SDK;Text Analytics API;Text Analytics;REST HTTP client;netcore451511 diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Properties/AssemblyInfo.cs b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Properties/AssemblyInfo.cs index 854ccaf04fc1..5fe94404b992 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Properties/AssemblyInfo.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/TextAnalytics/TextAnalytics/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ [assembly: AssemblyTitle("Microsoft Azure Cognitive Services Language Client Library")] [assembly: AssemblyDescription("Provides API functions for consuming Microsoft Azure Cognitive Services Language APIs.")] -[assembly: AssemblyVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/SDKs/_metadata/cognitiveservices_data-plane_TextAnalytics.txt b/src/SDKs/_metadata/cognitiveservices_data-plane_TextAnalytics.txt index fd437e8a5094..1ba9317a232e 100644 --- a/src/SDKs/_metadata/cognitiveservices_data-plane_TextAnalytics.txt +++ b/src/SDKs/_metadata/cognitiveservices_data-plane_TextAnalytics.txt @@ -4,11 +4,11 @@ Commencing code generation Generating CSharp code Executing AutoRest command cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/TextAnalytics/readme.md --csharp --version=latest --reflect-api-versions --tag=release_2_1 --csharp.output-folder=C:\mygitrepo\azure-sdk-for-net\src\SDKs\CognitiveServices\dataPlane\Language\TextAnalytics\TextAnalytics\Generated\TextAnalytics -2018-10-23 17:05:47 UTC +2019-02-23 00:17:59 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 9c1fe12b46cd05f44ed40a9e4bc25205cc343667 +Commit: a628a430e380b12082995b0882ac08bc457dc5fe AutoRest information Requested version: latest Bootstrapper version: autorest@2.0.4283