diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs index 0bf588003fb4b..65147343d9b53 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/AnalyzeOperationTests.cs @@ -389,7 +389,6 @@ public async Task AnalyzeOperationBatchWithPHIDomain() } [Test] - [Ignore("The statstics is not being returned from the service - https://github.com/Azure/azure-sdk-for-net/issues/16839")] public async Task AnalyzeOperationBatchWithStatisticsTest() { TextAnalyticsClient client = GetClient(); @@ -401,6 +400,10 @@ public async Task AnalyzeOperationBatchWithStatisticsTest() Language = "en", }, new TextDocumentInput("2", "Mi perro y mi gato tienen que ir al veterinario.") + { + Language = "es", + }, + new TextDocumentInput("3", "") { Language = "es", } @@ -428,12 +431,15 @@ public async Task AnalyzeOperationBatchWithStatisticsTest() Assert.IsNotNull(result); - Assert.AreEqual(2, result.Count); + Assert.AreEqual(3, result.Count); + + Assert.AreEqual(3, result.Statistics.DocumentCount); + Assert.AreEqual(2, result.Statistics.TransactionCount); + Assert.AreEqual(2, result.Statistics.ValidDocumentCount); + Assert.AreEqual(1, result.Statistics.InvalidDocumentCount); - // TODO - Update this once service start returning statistics. - // TODO - Add Other request level statistics. - Assert.AreEqual(0, result[0].Statistics.CharacterCount); - Assert.AreEqual(0, result[0].Statistics.TransactionCount); + Assert.AreEqual(51, result[0].Statistics.CharacterCount); + Assert.AreEqual(1, result[0].Statistics.TransactionCount); } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTest.json index d4658e83d470d..0ea8e99a1167c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTest.json +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTest.json @@ -1,21 +1,15 @@ { "Entries": [ { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze", "RequestMethod": "POST", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "324", + "Accept": "application/json, text/json", + "Content-Length": "361", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-b8c567859d72824db6b73bdb23b8c4a1-dcd400612fad5447-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-5fb5a1002c321a4394b6c59660e56def-1c17c8276b447843-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "7113589c3007a78af3272be840001637", "x-ms-return-client-request-id": "true" }, @@ -31,6 +25,11 @@ "id": "2", "text": "Mi perro y mi gato tienen que ir al veterinario.", "language": "es" + }, + { + "id": "3", + "text": "", + "language": "es" } ] }, @@ -47,55 +46,49 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "e75b3b22-777c-4fa9-9bf8-87999b278e02", - "Date": "Mon, 09 Nov 2020 19:44:40 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", + "apim-request-id": "3ab3a399-88a5-45ec-a03d-294292197c56", + "Date": "Sun, 07 Feb 2021 16:40:39 GMT", + "operation-location": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/066ac194-680e-4165-940d-3c7bf45eaaa9_637482528000000000", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "315" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "334" }, "ResponseBody": [] }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/066ac194-680e-4165-940d-3c7bf45eaaa9_637482528000000000?showStats=true", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "144d8fd0fea1ffdadc949dbbddaecf18", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "4986a806-6268-413a-96f9-1720f0a871d9", + "apim-request-id": "dc507642-309e-4ee5-b92e-ff8d12a38246", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:40 GMT", + "Date": "Sun, 07 Feb 2021 16:40:39 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "72" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "131" }, "ResponseBody": { "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:40Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", + "jobId": "066ac194-680e-4165-940d-3c7bf45eaaa9_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:39Z", + "createdDateTime": "2021-02-07T16:40:39Z", + "expirationDateTime": "2021-02-08T16:40:39Z", "status": "notStarted", "errors": [], "tasks": { "details": { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:40Z" + "lastUpdateDateTime": "2021-02-07T16:40:39Z" }, "completed": 0, "failed": 0, @@ -105,138 +98,38 @@ } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/066ac194-680e-4165-940d-3c7bf45eaaa9_637482528000000000?showStats=true", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "451e25c95048143288e779fc762b7962", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "d3abbc47-9910-47d6-8f18-a2ccb57dca34", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:41 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "90" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:40Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:40Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 0, - "total": 0 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "f329f0ff21bb9efb7e13957393cfc944", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "c6386b4f-37b7-4fe9-bd3c-e0afbf516c25", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:43 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "41" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:40Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:40Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 0, - "total": 0 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "1b1f1358d0e27fee5d388bb985dd89b1", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "8b956ac7-1273-4c56-9663-06c8cd5542cb", + "apim-request-id": "8b923f02-6432-4ec2-aba9-b36d1481b62f", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:44 GMT", + "Date": "Sun, 07 Feb 2021 16:40:41 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", + "x-content-type-options": "nosniff", "x-envoy-upstream-service-time": "80" }, "ResponseBody": { "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:40Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", + "jobId": "066ac194-680e-4165-940d-3c7bf45eaaa9_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:39Z", + "createdDateTime": "2021-02-07T16:40:39Z", + "expirationDateTime": "2021-02-08T16:40:39Z", "status": "notStarted", "errors": [], "tasks": { "details": { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:40Z" + "lastUpdateDateTime": "2021-02-07T16:40:39Z" }, "completed": 0, "failed": 0, @@ -246,185 +139,38 @@ } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/066ac194-680e-4165-940d-3c7bf45eaaa9_637482528000000000?showStats=true", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "edbc3b1bdb85a75d2980c735bbbe81b9", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "d3e8fdc8-15f7-4404-b817-0d032467041d", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:45 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "81" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:40Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:40Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 0, - "total": 0 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "63a4341e5d0b2f8001a99582954218a0", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "99432220-45b8-47f0-9d9b-37c51ac55c51", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:46 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "144" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:45Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", - "status": "notStarted", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:45Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "5758e38adc137cbfb678f16108b9c49e", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "01285735-3397-498f-89bb-30669cc9d78b", - "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:48 GMT", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "54" - }, - "ResponseBody": { - "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:45Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", - "status": "running", - "errors": [], - "tasks": { - "details": { - "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:45Z" - }, - "completed": 0, - "failed": 0, - "inProgress": 1, - "total": 1 - } - } - }, - { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000?showStats=true", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], - "x-ms-client-request-id": "519bd2b72539bda5ba8debdc46da12e7", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "f329f0ff21bb9efb7e13957393cfc944", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "4a51c3a2-5e15-4d23-b943-349a80df7299", + "apim-request-id": "afa9743c-4ddb-4b88-9229-fb961dd30d3c", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:44:49 GMT", + "Date": "Sun, 07 Feb 2021 16:40:44 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "162" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "609" }, "ResponseBody": { "displayName": "AnalyzeOperationTest", - "jobId": "1075d4f9-b87f-4f6d-aa6d-98a39ed296cd_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:44:45Z", - "createdDateTime": "2020-11-09T19:44:40Z", - "expirationDateTime": "2020-11-11T19:44:40Z", + "jobId": "066ac194-680e-4165-940d-3c7bf45eaaa9_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:42Z", + "createdDateTime": "2021-02-07T16:40:39Z", + "expirationDateTime": "2021-02-08T16:40:39Z", "status": "succeeded", "errors": [], "tasks": { "details": { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:45Z" + "lastUpdateDateTime": "2021-02-07T16:40:42Z" }, "completed": 1, "failed": 0, @@ -433,9 +179,14 @@ "keyPhraseExtractionTasks": [ { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:44:45.7681971Z", + "lastUpdateDateTime": "2021-02-07T16:40:42.3512057Z", "results": { - "inTerminalState": true, + "statistics": { + "documentsCount": 3, + "validDocumentsCount": 2, + "erroneousDocumentsCount": 1, + "transactionsCount": 2 + }, "documents": [ { "id": "1", @@ -444,6 +195,10 @@ "Paul Allen", "Microsoft" ], + "statistics": { + "charactersCount": 51, + "transactionsCount": 1 + }, "warnings": [] }, { @@ -453,10 +208,26 @@ "perro", "veterinario" ], + "statistics": { + "charactersCount": 48, + "transactionsCount": 1 + }, "warnings": [] } ], - "errors": [], + "errors": [ + { + "id": "3", + "error": { + "code": "InvalidRequest", + "message": "Invalid document in request.", + "innererror": { + "code": "InvalidDocument", + "message": "Document text is empty." + } + } + } + ], "modelVersion": "2020-07-01" } } @@ -468,6 +239,6 @@ "Variables": { "RandomSeed": "267372785", "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" + "TEXT_ANALYTICS_ENDPOINT": "https://westeurope.api.cognitive.microsoft.com/" } } \ No newline at end of file diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTestAsync.json index 13b0b281346b2..205cfba069db7 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTestAsync.json +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/AnalyzeOperationTests/AnalyzeOperationBatchWithStatisticsTestAsync.json @@ -1,21 +1,15 @@ { "Entries": [ { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze", "RequestMethod": "POST", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], - "Content-Length": "324", + "Accept": "application/json, text/json", + "Content-Length": "361", "Content-Type": "application/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-5442ca2c41351c4994deb7692cdcdaf2-70d91de47108ae47-00", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "traceparent": "00-f6881ce15206c9449ada601947bbcb3c-9a9e5eaf34baab45-00", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "2542d8e9f699af8c456bc28823041414", "x-ms-return-client-request-id": "true" }, @@ -31,6 +25,11 @@ "id": "2", "text": "Mi perro y mi gato tienen que ir al veterinario.", "language": "es" + }, + { + "id": "3", + "text": "", + "language": "es" } ] }, @@ -47,55 +46,49 @@ }, "StatusCode": 202, "ResponseHeaders": { - "apim-request-id": "0084a1cb-863f-48c4-b513-520191c95510", - "Date": "Mon, 09 Nov 2020 19:32:56 GMT", - "operation-location": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/6b66365b-5513-46af-892d-1ec946de6c10_637404768000000000", + "apim-request-id": "95a17e6a-2eaa-4354-a58e-52dce3ab9ab6", + "Date": "Sun, 07 Feb 2021 16:40:45 GMT", + "operation-location": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "165" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "1068" }, "ResponseBody": [] }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/6b66365b-5513-46af-892d-1ec946de6c10_637404768000000000?showStats=true", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000?showStats=true", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "ed9d01e6f22a03f27d82800089c0a199", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "13a052f1-d5fc-44fb-bb0b-75a655faa3b7", + "apim-request-id": "e656ccf0-86c5-4f9a-9e93-ceb2f5254027", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:32:56 GMT", + "Date": "Sun, 07 Feb 2021 16:40:46 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "13" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "502" }, "ResponseBody": { "displayName": "AnalyzeOperationTest", - "jobId": "6b66365b-5513-46af-892d-1ec946de6c10_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:32:56Z", - "createdDateTime": "2020-11-09T19:32:56Z", - "expirationDateTime": "2020-11-11T19:32:56Z", + "jobId": "b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:44Z", + "createdDateTime": "2021-02-07T16:40:44Z", + "expirationDateTime": "2021-02-08T16:40:44Z", "status": "notStarted", "errors": [], "tasks": { "details": { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:32:56Z" + "lastUpdateDateTime": "2021-02-07T16:40:44Z" }, "completed": 0, "failed": 0, @@ -105,44 +98,38 @@ } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/6b66365b-5513-46af-892d-1ec946de6c10_637404768000000000?showStats=true", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000?showStats=true", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "90b6c8c3c1a1af318c24ffc2d4d26635", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "c832164d-6bfe-4d2b-b123-e4603f2ada45", + "apim-request-id": "74358c60-248e-45ac-a5b8-553a471c0e65", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:32:57 GMT", + "Date": "Sun, 07 Feb 2021 16:40:47 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "69" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "185" }, "ResponseBody": { "displayName": "AnalyzeOperationTest", - "jobId": "6b66365b-5513-46af-892d-1ec946de6c10_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:32:56Z", - "createdDateTime": "2020-11-09T19:32:56Z", - "expirationDateTime": "2020-11-11T19:32:56Z", - "status": "running", + "jobId": "b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:47Z", + "createdDateTime": "2021-02-07T16:40:44Z", + "expirationDateTime": "2021-02-08T16:40:44Z", + "status": "notStarted", "errors": [], "tasks": { "details": { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:32:56Z" + "lastUpdateDateTime": "2021-02-07T16:40:47Z" }, "completed": 0, "failed": 0, @@ -152,44 +139,120 @@ } }, { - "RequestUri": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com/text/analytics/v3.1-preview.3/analyze/jobs/6b66365b-5513-46af-892d-1ec946de6c10_637404768000000000?showStats=true", + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000?showStats=true", "RequestMethod": "GET", "RequestHeaders": { - "Accept": [ - "application/json", - "text/json" - ], + "Accept": "application/json, text/json", "Ocp-Apim-Subscription-Key": "Sanitized", - "User-Agent": [ - "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20201109.1", - "(.NET Core 4.6.29321.03; Microsoft Windows 10.0.19042 )" - ], + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", "x-ms-client-request-id": "7d35e0d1c2bff7dee53fa717758b2584", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "apim-request-id": "e94b9645-6def-4cd7-9015-3fc908d713c8", + "apim-request-id": "292af872-7c09-414c-b810-f30adc33dc39", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 07 Feb 2021 16:40:48 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "83" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationTest", + "jobId": "b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:47Z", + "createdDateTime": "2021-02-07T16:40:44Z", + "expirationDateTime": "2021-02-08T16:40:44Z", + "status": "notStarted", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationTest", + "lastUpdateDateTime": "2021-02-07T16:40:47Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000?showStats=true", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "5ac529c9844e2473cfee6106f2302eaa", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "be0d2d82-a73f-495a-acf1-f7d75b8574d3", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 07 Feb 2021 16:40:50 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "Transfer-Encoding": "chunked", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "56" + }, + "ResponseBody": { + "displayName": "AnalyzeOperationTest", + "jobId": "b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:47Z", + "createdDateTime": "2021-02-07T16:40:44Z", + "expirationDateTime": "2021-02-08T16:40:44Z", + "status": "running", + "errors": [], + "tasks": { + "details": { + "name": "AnalyzeOperationTest", + "lastUpdateDateTime": "2021-02-07T16:40:47Z" + }, + "completed": 0, + "failed": 0, + "inProgress": 1, + "total": 1 + } + } + }, + { + "RequestUri": "https://westeurope.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000?showStats=true", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json, text/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.TextAnalytics/5.1.0-alpha.20210207.1 (.NET Framework 4.8.4250.0; Microsoft Windows 10.0.19042 )", + "x-ms-client-request-id": "a82f4b1b238a00d9eabeaa62191a3900", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4f53e380-c5ec-4be3-b26a-9fb5483411fb", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 09 Nov 2020 19:32:59 GMT", + "Date": "Sun, 07 Feb 2021 16:40:51 GMT", "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", "Transfer-Encoding": "chunked", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "108" + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "132" }, "ResponseBody": { "displayName": "AnalyzeOperationTest", - "jobId": "6b66365b-5513-46af-892d-1ec946de6c10_637404768000000000", - "lastUpdateDateTime": "2020-11-09T19:32:56Z", - "createdDateTime": "2020-11-09T19:32:56Z", - "expirationDateTime": "2020-11-11T19:32:56Z", + "jobId": "b191aa08-0226-46c6-bb64-c7ff4002b8e4_637482528000000000", + "lastUpdateDateTime": "2021-02-07T16:40:47Z", + "createdDateTime": "2021-02-07T16:40:44Z", + "expirationDateTime": "2021-02-08T16:40:44Z", "status": "succeeded", "errors": [], "tasks": { "details": { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:32:56Z" + "lastUpdateDateTime": "2021-02-07T16:40:47Z" }, "completed": 1, "failed": 0, @@ -198,9 +261,14 @@ "keyPhraseExtractionTasks": [ { "name": "AnalyzeOperationTest", - "lastUpdateDateTime": "2020-11-09T19:32:56.9165849Z", + "lastUpdateDateTime": "2021-02-07T16:40:47.3607368Z", "results": { - "inTerminalState": true, + "statistics": { + "documentsCount": 3, + "validDocumentsCount": 2, + "erroneousDocumentsCount": 1, + "transactionsCount": 2 + }, "documents": [ { "id": "1", @@ -209,6 +277,10 @@ "Paul Allen", "Microsoft" ], + "statistics": { + "charactersCount": 51, + "transactionsCount": 1 + }, "warnings": [] }, { @@ -218,10 +290,26 @@ "perro", "veterinario" ], + "statistics": { + "charactersCount": 48, + "transactionsCount": 1 + }, "warnings": [] } ], - "errors": [], + "errors": [ + { + "id": "3", + "error": { + "code": "InvalidRequest", + "message": "Invalid document in request.", + "innererror": { + "code": "InvalidDocument", + "message": "Document text is empty." + } + } + } + ], "modelVersion": "2020-07-01" } } @@ -233,6 +321,6 @@ "Variables": { "RandomSeed": "1456992479", "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://textanalytics-westeurope.ppe.cognitiveservices.azure.com" + "TEXT_ANALYTICS_ENDPOINT": "https://westeurope.api.cognitive.microsoft.com/" } } \ No newline at end of file