From 26da83d0c855096c13eb68ce63a064f8010c6dac Mon Sep 17 00:00:00 2001 From: Minh-Anh Phan <111523473+minhanh-phan@users.noreply.github.com> Date: Fri, 4 Nov 2022 11:14:59 -0700 Subject: [PATCH] [Language Text] Add Script and Auto Language Detection Tests (#23697) --- ...turns_script_with_detectlanguageinput.json | 75 + ...ch_input_with_auto_language_detection.json | 1302 +++++++++++++++++ ...turns_script_with_detectlanguageinput.json | 75 + ...ch_input_with_auto_language_detection.json | 1065 ++++++++++++++ ...turns_script_with_detectlanguageinput.json | 66 + ...ch_input_with_auto_language_detection.json | 1011 +++++++++++++ ...turns_script_with_detectlanguageinput.json | 66 + ...ch_input_with_auto_language_detection.json | 1011 +++++++++++++ .../test/public/analyze.spec.ts | 11 + .../test/public/analyzeBatch.spec.ts | 38 + .../test/public/expectations.ts | 234 +++ 11 files changed, 4954 insertions(+) create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json create mode 100644 sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json new file mode 100644 index 000000000000..1ca873fdd1ca --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/:analyze-text?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "172", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "3c93242a-5434-477b-86c2-c058b0f58f58", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": { + "kind": "LanguageDetection", + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "Tumhara naam kya hai?", + "countryHint": "in" + } + ] + }, + "parameters": { + "modelVersion": "2022-04-10-preview" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "f717dafc-8185-4a35-8492-662a863cb222", + "Content-Length": "228", + "Content-Type": "application/json; charset=utf-8", + "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1,CognitiveServices.TextAnalytics.TextRecords=1", + "Date": "Fri, 04 Nov 2022 16:24:01 GMT", + "Set-Cookie": ".AspNetCore.Mvc.CookieTempDataProvider=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "10", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "kind": "LanguageDetectionResults", + "results": { + "documents": [ + { + "id": "0", + "detectedLanguage": { + "name": "Hindi", + "iso6391Name": "hi", + "confidenceScore": 1.0, + "script": "Latin" + }, + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2022-04-10-preview" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json new file mode 100644 index 000000000000..9418c0b49033 --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json @@ -0,0 +1,1302 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/analyze-text/jobs?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "498", + "Content-Type": "application/json", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "3edaad93-95f3-459d-a106-6fee519b3587", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": { + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "I will go to the park.", + "language": "auto" + }, + { + "id": "1", + "text": "Este es un document escrito en Espa\u00F1ol.", + "language": "auto" + }, + { + "id": "2", + "text": "\u732B\u306F\u5E78\u305B", + "language": "auto" + } + ] + }, + "tasks": [ + { + "kind": "EntityRecognition", + "parameters": {} + }, + { + "kind": "PiiEntityRecognition", + "parameters": {} + }, + { + "kind": "SentimentAnalysis", + "parameters": {} + }, + { + "kind": "KeyPhraseExtraction", + "parameters": {} + }, + { + "kind": "EntityLinking", + "parameters": {} + }, + { + "kind": "Healthcare", + "parameters": {} + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "4ebbd9c3-5efe-4f84-a7b0-e4cd68c021f8", + "Content-Length": "0", + "Date": "Fri, 04 Nov 2022 16:24:08 GMT", + "operation-location": "https://endpoint/language/analyze-text/jobs/531d99f4-8d22-473d-8e3b-dae9f7424228?api-version=2022-10-01-preview", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "201", + "x-ms-region": "West US 2" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/531d99f4-8d22-473d-8e3b-dae9f7424228?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "57861383-160b-40cb-ab93-7b96d4d6746f", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "93ddd086-c196-45dc-9743-ab5e13edacd3", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:08 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "9", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "531d99f4-8d22-473d-8e3b-dae9f7424228", + "lastUpdateDateTime": "2022-11-04T16:24:08Z", + "createdDateTime": "2022-11-04T16:24:08Z", + "expirationDateTime": "2022-11-05T16:24:08Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/531d99f4-8d22-473d-8e3b-dae9f7424228?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "f2c5b19d-1d92-4f35-b5f0-18e8847c27b4", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "6e438057-bfcb-438a-9822-08c929332480", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:08 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "8", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "531d99f4-8d22-473d-8e3b-dae9f7424228", + "lastUpdateDateTime": "2022-11-04T16:24:08Z", + "createdDateTime": "2022-11-04T16:24:08Z", + "expirationDateTime": "2022-11-05T16:24:08Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/531d99f4-8d22-473d-8e3b-dae9f7424228?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "14b6540d-1c10-43d8-9b17-339e0679e2b1", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "97c64407-ef29-41fb-b4cc-2d4fbc0a6064", + "Content-Length": "3826", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:10 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "171", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "531d99f4-8d22-473d-8e3b-dae9f7424228", + "lastUpdateDateTime": "2022-11-04T16:24:10Z", + "createdDateTime": "2022-11-04T16:24:08Z", + "expirationDateTime": "2022-11-05T16:24:08Z", + "status": "running", + "errors": [], + "tasks": { + "completed": 4, + "failed": 0, + "inProgress": 2, + "total": 6, + "items": [ + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.245769Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.1361762Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.2619599Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.2779558Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/531d99f4-8d22-473d-8e3b-dae9f7424228?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "0a9c1aa4-488f-423c-8cc9-bbe048a566f9", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "0dc4b08a-3e4a-41fb-927a-4b8cbe1aa056", + "Content-Length": "5853", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:12 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "301", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "531d99f4-8d22-473d-8e3b-dae9f7424228", + "lastUpdateDateTime": "2022-11-04T16:24:11Z", + "createdDateTime": "2022-11-04T16:24:08Z", + "expirationDateTime": "2022-11-05T16:24:08Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:11.0184845Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.245769Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.1361762Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.2619599Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.5480867Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.2779558Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/531d99f4-8d22-473d-8e3b-dae9f7424228?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "9030dd2e-d4ac-49be-b960-f69210898ca9", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "5f7373e3-77c9-4d57-900a-a658b1eb85e9", + "Content-Length": "5853", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:12 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "252", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "531d99f4-8d22-473d-8e3b-dae9f7424228", + "lastUpdateDateTime": "2022-11-04T16:24:11Z", + "createdDateTime": "2022-11-04T16:24:08Z", + "expirationDateTime": "2022-11-05T16:24:08Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:11.0184845Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.245769Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.1361762Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.2619599Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.5480867Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:10.2779558Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json new file mode 100644 index 000000000000..02a3980269a7 --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/:analyze-text?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Connection": "keep-alive", + "Content-Length": "172", + "Content-Type": "application/json", + "ocp-apim-subscription-key": "api_key", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "f8436c69-5ca2-454d-8201-a79fd4c48940", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": { + "kind": "LanguageDetection", + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "Tumhara naam kya hai?", + "countryHint": "in" + } + ] + }, + "parameters": { + "modelVersion": "2022-04-10-preview" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "2c0158bc-5efa-413b-9c70-cd0421b3f3e9", + "Content-Length": "228", + "Content-Type": "application/json; charset=utf-8", + "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1,CognitiveServices.TextAnalytics.TextRecords=1", + "Date": "Fri, 04 Nov 2022 16:24:01 GMT", + "Set-Cookie": ".AspNetCore.Mvc.CookieTempDataProvider=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "9", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "kind": "LanguageDetectionResults", + "results": { + "documents": [ + { + "id": "0", + "detectedLanguage": { + "name": "Hindi", + "iso6391Name": "hi", + "confidenceScore": 1.0, + "script": "Latin" + }, + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2022-04-10-preview" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json new file mode 100644 index 000000000000..b9cbe3639372 --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/browsers/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json @@ -0,0 +1,1065 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/analyze-text/jobs?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Connection": "keep-alive", + "Content-Length": "498", + "Content-Type": "application/json", + "ocp-apim-subscription-key": "api_key", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "82f7858a-335e-4e9d-aa8a-b9121378f608", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": { + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "I will go to the park.", + "language": "auto" + }, + { + "id": "1", + "text": "Este es un document escrito en Espa\u00F1ol.", + "language": "auto" + }, + { + "id": "2", + "text": "\u732B\u306F\u5E78\u305B", + "language": "auto" + } + ] + }, + "tasks": [ + { + "kind": "EntityRecognition", + "parameters": {} + }, + { + "kind": "PiiEntityRecognition", + "parameters": {} + }, + { + "kind": "SentimentAnalysis", + "parameters": {} + }, + { + "kind": "KeyPhraseExtraction", + "parameters": {} + }, + { + "kind": "EntityLinking", + "parameters": {} + }, + { + "kind": "Healthcare", + "parameters": {} + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "87627fe6-4c04-4c5f-a822-7f2a737e0f0a", + "Content-Length": "0", + "Date": "Fri, 04 Nov 2022 16:24:02 GMT", + "operation-location": "https://endpoint/language/analyze-text/jobs/16ec2bb0-28f4-4de8-8474-d57ccb74229c?api-version=2022-10-01-preview", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "294", + "x-ms-region": "West US 2" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/16ec2bb0-28f4-4de8-8474-d57ccb74229c?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Connection": "keep-alive", + "ocp-apim-subscription-key": "api_key", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "ede36824-4224-430c-b43c-8f5cb0e3cdf8", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "e474a253-3df7-4056-ae36-0242942cef87", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:02 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "11", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "16ec2bb0-28f4-4de8-8474-d57ccb74229c", + "lastUpdateDateTime": "2022-11-04T16:24:02Z", + "createdDateTime": "2022-11-04T16:24:02Z", + "expirationDateTime": "2022-11-05T16:24:02Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/16ec2bb0-28f4-4de8-8474-d57ccb74229c?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Connection": "keep-alive", + "ocp-apim-subscription-key": "api_key", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "0b96ff04-a1fd-41f1-9ead-3d0a264ccd45", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "b56270e8-45f5-443b-9b37-2b5dc0ff8db7", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:02 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "9", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "16ec2bb0-28f4-4de8-8474-d57ccb74229c", + "lastUpdateDateTime": "2022-11-04T16:24:02Z", + "createdDateTime": "2022-11-04T16:24:02Z", + "expirationDateTime": "2022-11-05T16:24:02Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/16ec2bb0-28f4-4de8-8474-d57ccb74229c?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Connection": "keep-alive", + "ocp-apim-subscription-key": "api_key", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "9e08ddc1-cfff-43f9-892d-d7551ef17a87", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "5b3aac16-688b-4fd0-b0f2-bd42440a1b0f", + "Content-Length": "279", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:03 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "8", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "16ec2bb0-28f4-4de8-8474-d57ccb74229c", + "lastUpdateDateTime": "2022-11-04T16:24:03Z", + "createdDateTime": "2022-11-04T16:24:02Z", + "expirationDateTime": "2022-11-05T16:24:02Z", + "status": "running", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/16ec2bb0-28f4-4de8-8474-d57ccb74229c?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Connection": "keep-alive", + "ocp-apim-subscription-key": "api_key", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "ddc05152-d07e-4f4a-8b9d-15f8c813a532", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "475653d6-e31e-42eb-b421-34f3ad4daa1a", + "Content-Length": "5851", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:07 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "384", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "16ec2bb0-28f4-4de8-8474-d57ccb74229c", + "lastUpdateDateTime": "2022-11-04T16:24:06Z", + "createdDateTime": "2022-11-04T16:24:02Z", + "expirationDateTime": "2022-11-05T16:24:02Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.0016912Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.1156851Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.054226Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.317843Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:06.499407Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.1880965Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/16ec2bb0-28f4-4de8-8474-d57ccb74229c?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US", + "Connection": "keep-alive", + "ocp-apim-subscription-key": "api_key", + "Referer": "http://localhost:9876/", + "sec-ch-ua": "", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/103.0.5058.0 Safari/537.36", + "x-ms-client-request-id": "b57ed967-1735-411a-abf5-967f32f707d2", + "x-ms-useragent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 OS/Linuxx86_64" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "db5d0598-df20-495d-a4ea-7857d22d2dd3", + "Content-Length": "5851", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:24:07 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "485", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "16ec2bb0-28f4-4de8-8474-d57ccb74229c", + "lastUpdateDateTime": "2022-11-04T16:24:06Z", + "createdDateTime": "2022-11-04T16:24:02Z", + "expirationDateTime": "2022-11-05T16:24:02Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.0016912Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.1156851Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.054226Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.317843Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:06.499407Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:24:05.1880965Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json b/sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json new file mode 100644 index 000000000000..88c65c86e298 --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json @@ -0,0 +1,66 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/:analyze-text?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "172", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "9b0679fd-e33c-41da-a947-a9215e8b55d2" + }, + "RequestBody": { + "kind": "LanguageDetection", + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "Tumhara naam kya hai?", + "countryHint": "in" + } + ] + }, + "parameters": { + "modelVersion": "2022-04-10-preview" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "f7c012fd-5fc2-4288-8a14-34f095833822", + "Content-Length": "228", + "Content-Type": "application/json; charset=utf-8", + "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1,CognitiveServices.TextAnalytics.TextRecords=1", + "Date": "Fri, 04 Nov 2022 16:23:49 GMT", + "Set-Cookie": ".AspNetCore.Mvc.CookieTempDataProvider=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "kind": "LanguageDetectionResults", + "results": { + "documents": [ + { + "id": "0", + "detectedLanguage": { + "name": "Hindi", + "iso6391Name": "hi", + "confidenceScore": 1.0, + "script": "Latin" + }, + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2022-04-10-preview" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json b/sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json new file mode 100644 index 000000000000..7e648ae9d82d --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/node/aad_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json @@ -0,0 +1,1011 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/analyze-text/jobs?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "498", + "Content-Type": "application/json", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "036ee3e0-1f09-4c7a-83f6-2b1fa0bb2184" + }, + "RequestBody": { + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "I will go to the park.", + "language": "auto" + }, + { + "id": "1", + "text": "Este es un document escrito en Espa\u00F1ol.", + "language": "auto" + }, + { + "id": "2", + "text": "\u732B\u306F\u5E78\u305B", + "language": "auto" + } + ] + }, + "tasks": [ + { + "kind": "EntityRecognition", + "parameters": {} + }, + { + "kind": "PiiEntityRecognition", + "parameters": {} + }, + { + "kind": "SentimentAnalysis", + "parameters": {} + }, + { + "kind": "KeyPhraseExtraction", + "parameters": {} + }, + { + "kind": "EntityLinking", + "parameters": {} + }, + { + "kind": "Healthcare", + "parameters": {} + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "e268033b-d989-4fa3-96b6-45c03f449cfb", + "Content-Length": "0", + "Date": "Fri, 04 Nov 2022 16:23:54 GMT", + "operation-location": "https://endpoint/language/analyze-text/jobs/19b03dc6-1c03-4db1-98ea-ecdc5e856fa3?api-version=2022-10-01-preview", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "302", + "x-ms-region": "West US 2" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/19b03dc6-1c03-4db1-98ea-ecdc5e856fa3?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "9a56c69d-0ca1-4ee9-945e-f13ba9434a5b" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "70a4df81-aa6c-404f-86b5-f8a3dc4c55da", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:54 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "7", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "19b03dc6-1c03-4db1-98ea-ecdc5e856fa3", + "lastUpdateDateTime": "2022-11-04T16:23:54Z", + "createdDateTime": "2022-11-04T16:23:54Z", + "expirationDateTime": "2022-11-05T16:23:54Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/19b03dc6-1c03-4db1-98ea-ecdc5e856fa3?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "1c84f500-1bc6-4ee7-9f56-3d9f83fa7f9d" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "8a8a921e-c8c6-4a9d-a45c-cb5a3c224038", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:54 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "18", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "19b03dc6-1c03-4db1-98ea-ecdc5e856fa3", + "lastUpdateDateTime": "2022-11-04T16:23:54Z", + "createdDateTime": "2022-11-04T16:23:54Z", + "expirationDateTime": "2022-11-05T16:23:54Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/19b03dc6-1c03-4db1-98ea-ecdc5e856fa3?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "03ea0de2-eec1-4822-90ca-2a7997b07292" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "33a8c510-002a-43f3-9bdc-b08f67cff03e", + "Content-Length": "279", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:56 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "6", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "19b03dc6-1c03-4db1-98ea-ecdc5e856fa3", + "lastUpdateDateTime": "2022-11-04T16:23:55Z", + "createdDateTime": "2022-11-04T16:23:54Z", + "expirationDateTime": "2022-11-05T16:23:54Z", + "status": "running", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/19b03dc6-1c03-4db1-98ea-ecdc5e856fa3?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "5708420f-5772-498c-acd3-0853041c3dfa" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4d40f30a-cf76-487f-b6ed-7ceda42abbd4", + "Content-Length": "5853", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:59 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "357", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "19b03dc6-1c03-4db1-98ea-ecdc5e856fa3", + "lastUpdateDateTime": "2022-11-04T16:23:58Z", + "createdDateTime": "2022-11-04T16:23:54Z", + "expirationDateTime": "2022-11-05T16:23:54Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:56.986907Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:58.6386839Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.0316059Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.2102511Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.1280515Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.2238304Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/19b03dc6-1c03-4db1-98ea-ecdc5e856fa3?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "72d58b3c-81f6-442c-b0bb-50762cd498a8" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4fd73761-94b5-4a67-b1cf-47680e1644f1", + "Content-Length": "5853", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:59 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "513", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "19b03dc6-1c03-4db1-98ea-ecdc5e856fa3", + "lastUpdateDateTime": "2022-11-04T16:23:58Z", + "createdDateTime": "2022-11-04T16:23:54Z", + "expirationDateTime": "2022-11-05T16:23:54Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:56.986907Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:58.6386839Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.0316059Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.2102511Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.1280515Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:57.2238304Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json b/sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json new file mode 100644 index 000000000000..538fec9bb2b3 --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyze_languagedetection/recording_service_returns_script_with_detectlanguageinput.json @@ -0,0 +1,66 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/:analyze-text?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Connection": "keep-alive", + "Content-Length": "172", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "api_key", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "b18a132e-3462-44da-86fe-48ef72326b18" + }, + "RequestBody": { + "kind": "LanguageDetection", + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "Tumhara naam kya hai?", + "countryHint": "in" + } + ] + }, + "parameters": { + "modelVersion": "2022-04-10-preview" + } + }, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "2a143490-f4d1-48b8-95b3-18ac0c05ab8a", + "Content-Length": "228", + "Content-Type": "application/json; charset=utf-8", + "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1,CognitiveServices.TextAnalytics.TextRecords=1", + "Date": "Fri, 04 Nov 2022 16:23:48 GMT", + "Set-Cookie": ".AspNetCore.Mvc.CookieTempDataProvider=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "50", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "kind": "LanguageDetectionResults", + "results": { + "documents": [ + { + "id": "0", + "detectedLanguage": { + "name": "Hindi", + "iso6391Name": "hi", + "confidenceScore": 1.0, + "script": "Latin" + }, + "warnings": [] + } + ], + "errors": [], + "modelVersion": "2022-04-10-preview" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json b/sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json new file mode 100644 index 000000000000..010323f565da --- /dev/null +++ b/sdk/cognitivelanguage/ai-language-text/recordings/node/apikey_textanalysisclient_analyzebatch_general_behavior/recording_whole_batch_input_with_auto_language_detection.json @@ -0,0 +1,1011 @@ +{ + "Entries": [ + { + "RequestUri": "https://endpoint/language/analyze-text/jobs?api-version=2022-10-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Connection": "keep-alive", + "Content-Length": "498", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "api_key", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "b0cc5952-4315-4488-b403-96b958a56c0e" + }, + "RequestBody": { + "analysisInput": { + "documents": [ + { + "id": "0", + "text": "I will go to the park.", + "language": "auto" + }, + { + "id": "1", + "text": "Este es un document escrito en Espa\u00F1ol.", + "language": "auto" + }, + { + "id": "2", + "text": "\u732B\u306F\u5E78\u305B", + "language": "auto" + } + ] + }, + "tasks": [ + { + "kind": "EntityRecognition", + "parameters": {} + }, + { + "kind": "PiiEntityRecognition", + "parameters": {} + }, + { + "kind": "SentimentAnalysis", + "parameters": {} + }, + { + "kind": "KeyPhraseExtraction", + "parameters": {} + }, + { + "kind": "EntityLinking", + "parameters": {} + }, + { + "kind": "Healthcare", + "parameters": {} + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "641dfb18-a7e6-4bba-b63e-7d5efd405c2e", + "Content-Length": "0", + "Date": "Fri, 04 Nov 2022 16:23:49 GMT", + "operation-location": "https://endpoint/language/analyze-text/jobs/2f0666d4-987f-4755-8a76-68e3a628ac59?api-version=2022-10-01-preview", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "266", + "x-ms-region": "West US 2" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/2f0666d4-987f-4755-8a76-68e3a628ac59?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "api_key", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "592ea0eb-046b-4657-9333-43b9f4d73f05" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "66322d36-7c59-4a96-a821-dcbb2dc1e103", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:49 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "12", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "2f0666d4-987f-4755-8a76-68e3a628ac59", + "lastUpdateDateTime": "2022-11-04T16:23:49Z", + "createdDateTime": "2022-11-04T16:23:49Z", + "expirationDateTime": "2022-11-05T16:23:49Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/2f0666d4-987f-4755-8a76-68e3a628ac59?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "api_key", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "fe29ca81-1b17-426f-9a19-b6c4d35aa441" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "3ce52458-c528-4655-8dc7-93cef85a7036", + "Content-Length": "282", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:49 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "12", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "2f0666d4-987f-4755-8a76-68e3a628ac59", + "lastUpdateDateTime": "2022-11-04T16:23:49Z", + "createdDateTime": "2022-11-04T16:23:49Z", + "expirationDateTime": "2022-11-05T16:23:49Z", + "status": "notStarted", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/2f0666d4-987f-4755-8a76-68e3a628ac59?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "api_key", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "6a4f2fbe-e44d-45da-8e2d-b04bf6eaa1b6" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "09c7f921-83c2-4f37-a1b1-e0a3c1fa3eb4", + "Content-Length": "279", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:51 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "16", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "2f0666d4-987f-4755-8a76-68e3a628ac59", + "lastUpdateDateTime": "2022-11-04T16:23:50Z", + "createdDateTime": "2022-11-04T16:23:49Z", + "expirationDateTime": "2022-11-05T16:23:49Z", + "status": "running", + "errors": [], + "tasks": { + "completed": 0, + "failed": 0, + "inProgress": 6, + "total": 6, + "items": [] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/2f0666d4-987f-4755-8a76-68e3a628ac59?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "api_key", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "885e7da7-92a9-45ca-ba92-9f4ac4cdb31c" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "51b5b502-e0c9-4231-81a5-7c3429fe83d4", + "Content-Length": "5854", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:53 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "314", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "2f0666d4-987f-4755-8a76-68e3a628ac59", + "lastUpdateDateTime": "2022-11-04T16:23:52Z", + "createdDateTime": "2022-11-04T16:23:49Z", + "expirationDateTime": "2022-11-05T16:23:49Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.2002843Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.2527591Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.0427126Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.1127438Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.3244112Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.1286471Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + }, + { + "RequestUri": "https://endpoint/language/analyze-text/jobs/2f0666d4-987f-4755-8a76-68e3a628ac59?api-version=2022-10-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Connection": "keep-alive", + "Ocp-Apim-Subscription-Key": "api_key", + "User-Agent": "azsdk-js-ai-language-text/1.1.0-beta.1 core-rest-pipeline/1.10.0 Node/v16.14.2 OS/(x64-Linux-5.4.0-1094-azure)", + "x-ms-client-request-id": "81145c98-8ad8-4ce3-a53b-1d3f960252dc" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "a6a6ce25-0f89-45e0-8a99-1c8d31e49441", + "Content-Length": "5854", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 04 Nov 2022 16:23:53 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "253", + "x-ms-region": "West US 2" + }, + "ResponseBody": { + "jobId": "2f0666d4-987f-4755-8a76-68e3a628ac59", + "lastUpdateDateTime": "2022-11-04T16:23:52Z", + "createdDateTime": "2022-11-04T16:23:49Z", + "expirationDateTime": "2022-11-05T16:23:49Z", + "status": "succeeded", + "errors": [], + "tasks": { + "completed": 6, + "failed": 0, + "inProgress": 0, + "total": 6, + "items": [ + { + "kind": "EntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.2002843Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [ + { + "text": "park", + "category": "Location", + "offset": 17, + "length": 4, + "confidenceScore": 0.99 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [ + { + "text": "un", + "category": "Quantity", + "subcategory": "Number", + "offset": 8, + "length": 2, + "confidenceScore": 0.8 + }, + { + "text": "Espa\u00F1ol", + "category": "Skill", + "offset": 31, + "length": 7, + "confidenceScore": 0.94 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "entities": [ + { + "text": "\u732B", + "category": "Product", + "offset": 0, + "length": 1, + "confidenceScore": 0.42 + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "PiiEntityRecognitionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.2527591Z", + "status": "succeeded", + "results": { + "documents": [ + { + "redactedText": "I will go to the park.", + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "Este es un document escrito en Espa\u00F1ol.", + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "redactedText": "\u732B\u306F\u5E78\u305B", + "id": "2", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2021-01-15" + } + }, + { + "kind": "SentimentAnalysisLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.0427126Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.0, + "neutral": 0.99, + "negative": 0.0 + }, + "offset": 0, + "length": 22, + "text": "I will go to the park." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "sentences": [ + { + "sentiment": "neutral", + "confidenceScores": { + "positive": 0.04, + "neutral": 0.92, + "negative": 0.04 + }, + "offset": 0, + "length": 39, + "text": "Este es un document escrito en Espa\u00F1ol." + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "sentences": [ + { + "sentiment": "positive", + "confidenceScores": { + "positive": 0.99, + "neutral": 0.01, + "negative": 0.0 + }, + "offset": 0, + "length": 4, + "text": "\u732B\u306F\u5E78\u305B" + } + ], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "KeyPhraseExtractionLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.1127438Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "keyPhrases": [ + "park" + ], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "keyPhrases": [ + "Espa\u00F1ol", + "document" + ], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + }, + { + "id": "2", + "keyPhrases": [], + "warnings": [], + "detectedLanguage": { + "name": "Japanese", + "iso6391Name": "ja", + "confidenceScore": 1.0 + }, + "isLanguageDefaulted": false + } + ], + "errors": [], + "modelVersion": "2022-10-01" + } + }, + { + "kind": "EntityLinkingLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.3244112Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "English", + "iso6391Name": "en", + "confidenceScore": 0.98 + }, + "isLanguageDefaulted": false + }, + { + "id": "1", + "entities": [], + "warnings": [], + "detectedLanguage": { + "name": "Spanish", + "iso6391Name": "es", + "confidenceScore": 0.75 + }, + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking" + } + } + } + ], + "modelVersion": "2021-06-01" + } + }, + { + "kind": "HealthcareLROResults", + "lastUpdateDateTime": "2022-11-04T16:23:52.1286471Z", + "status": "succeeded", + "results": { + "documents": [ + { + "id": "0", + "entities": [], + "relations": [], + "warnings": [], + "detectedLanguage": "en", + "isLanguageDefaulted": false + } + ], + "errors": [ + { + "id": "1", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027es\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + }, + { + "id": "2", + "error": { + "code": "InvalidArgument", + "message": "Invalid Language Code.", + "innererror": { + "code": "UnsupportedLanguageCode", + "message": "Invalid language code \u0027ja\u0027. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support" + } + } + } + ], + "modelVersion": "2022-03-01" + } + } + ] + } + } + } + ], + "Variables": {} +} diff --git a/sdk/cognitivelanguage/ai-language-text/test/public/analyze.spec.ts b/sdk/cognitivelanguage/ai-language-text/test/public/analyze.spec.ts index 3a9ca94e40b2..706fe8a7061b 100644 --- a/sdk/cognitivelanguage/ai-language-text/test/public/analyze.spec.ts +++ b/sdk/cognitivelanguage/ai-language-text/test/public/analyze.spec.ts @@ -53,6 +53,7 @@ import { expectation68, expectation69, expectation70, + expectation72, } from "./expectations"; const testDataEn = [ @@ -255,6 +256,16 @@ matrix([["APIKey", "AAD"]] as const, async (authMethod: AuthMethod) => { ); }); + it("service returns script with DetectLanguageInput[]", async function () { + const doc = ["Tumhara naam kya hai?"]; + assertActionResults( + await client.analyze(AnalyzeActionNames.LanguageDetection, doc, "in", { + modelVersion: "2022-04-10-preview", + }), + expectation72 + ); + }); + it("client accepts mixed-country DetectLanguageInput[]", async function () { const enDocs = testDataEn.map((text) => ({ id: getId(), diff --git a/sdk/cognitivelanguage/ai-language-text/test/public/analyzeBatch.spec.ts b/sdk/cognitivelanguage/ai-language-text/test/public/analyzeBatch.spec.ts index 85d94392aeea..380df6667f91 100644 --- a/sdk/cognitivelanguage/ai-language-text/test/public/analyzeBatch.spec.ts +++ b/sdk/cognitivelanguage/ai-language-text/test/public/analyzeBatch.spec.ts @@ -51,6 +51,7 @@ import { expectation32, expectation30, expectation31, + expectation71, } from "./expectations"; import { windows365ArticlePart1, windows365ArticlePart2 } from "./inputs"; import { getDocIDsFromState } from "../../src/lro"; @@ -861,6 +862,43 @@ matrix([["APIKey", "AAD"]] as const, async (authMethod: AuthMethod) => { await assertActionsResults(await poller.pollUntilDone(), expectation15); }); + it("whole batch input with auto language detection", async function () { + const docs = [ + "I will go to the park.", + "Este es un document escrito en Español.", + "猫は幸せ", + ]; + const poller = await client.beginAnalyzeBatch( + [ + { + kind: AnalyzeBatchActionNames.EntityRecognition, + }, + { + kind: AnalyzeBatchActionNames.PiiEntityRecognition, + }, + { + kind: AnalyzeBatchActionNames.SentimentAnalysis, + }, + { + kind: AnalyzeBatchActionNames.KeyPhraseExtraction, + }, + { + kind: AnalyzeBatchActionNames.EntityLinking, + }, + { + kind: AnalyzeBatchActionNames.Healthcare, + }, + ], + docs, + "auto", + { + updateIntervalInMs: pollingInterval, + defaultLanguage: "en", + } + ); + await assertActionsResults(await poller.pollUntilDone(), expectation71); + }); + it("invalid language hint", async function () { const docs = ["This should fail because we're passing in an invalid language hint"]; const poller = await client.beginAnalyzeBatch( diff --git a/sdk/cognitivelanguage/ai-language-text/test/public/expectations.ts b/sdk/cognitivelanguage/ai-language-text/test/public/expectations.ts index e5115817558d..41c935b4d9df 100644 --- a/sdk/cognitivelanguage/ai-language-text/test/public/expectations.ts +++ b/sdk/cognitivelanguage/ai-language-text/test/public/expectations.ts @@ -8494,3 +8494,237 @@ export const expectation70: DynamicClassificationResult[] = [ ], }, ]; + +export const expectation71: any = [ + { + kind: "EntityRecognition", + results: [ + { + id: "0", + warnings: [], + entities: [ + { text: "park", category: "Location", offset: 17, length: 4, confidenceScore: 0.99 }, + ], + detectedLanguage: { name: "English", iso6391Name: "en", confidenceScore: 0.98 }, + isLanguageDefaulted: false, + }, + { + id: "1", + warnings: [], + entities: [ + { + text: "un", + category: "Quantity", + subCategory: "Number", + offset: 8, + length: 2, + confidenceScore: 0.8, + }, + { text: "Español", category: "Skill", offset: 31, length: 7, confidenceScore: 0.94 }, + ], + detectedLanguage: { name: "Spanish", iso6391Name: "es", confidenceScore: 0.75 }, + isLanguageDefaulted: false, + }, + { + id: "2", + warnings: [], + entities: [ + { text: "猫", category: "Product", offset: 0, length: 1, confidenceScore: 0.42 }, + ], + detectedLanguage: { name: "Japanese", iso6391Name: "ja", confidenceScore: 1 }, + isLanguageDefaulted: false, + }, + ], + completedOn, + modelVersion, + }, + { + kind: "PiiEntityRecognition", + results: [ + { + id: "0", + warnings: [], + redactedText: "I will go to the park.", + entities: [], + detectedLanguage: { name: "English", iso6391Name: "en", confidenceScore: 0.98 }, + isLanguageDefaulted: false, + }, + { + id: "1", + warnings: [], + redactedText: "Este es un document escrito en Español.", + entities: [], + detectedLanguage: { name: "Spanish", iso6391Name: "es", confidenceScore: 0.75 }, + isLanguageDefaulted: false, + }, + { + id: "2", + warnings: [], + redactedText: "猫は幸せ", + entities: [], + detectedLanguage: { name: "Japanese", iso6391Name: "ja", confidenceScore: 1 }, + isLanguageDefaulted: false, + }, + ], + completedOn, + modelVersion, + }, + { + kind: "SentimentAnalysis", + results: [ + { + id: "0", + warnings: [], + sentiment: "neutral", + confidenceScores: { positive: 0, neutral: 0.99, negative: 0 }, + detectedLanguage: { name: "English", iso6391Name: "en", confidenceScore: 0.98 }, + isLanguageDefaulted: false, + sentences: [ + { + text: "I will go to the park.", + sentiment: "neutral", + confidenceScores: { positive: 0, neutral: 0.99, negative: 0 }, + offset: 0, + length: 22, + opinions: [], + }, + ], + }, + { + id: "1", + warnings: [], + sentiment: "neutral", + confidenceScores: { positive: 0.04, neutral: 0.92, negative: 0.04 }, + detectedLanguage: { name: "Spanish", iso6391Name: "es", confidenceScore: 0.75 }, + isLanguageDefaulted: false, + sentences: [ + { + text: "Este es un document escrito en Español.", + sentiment: "neutral", + confidenceScores: { positive: 0.04, neutral: 0.92, negative: 0.04 }, + offset: 0, + length: 39, + opinions: [], + }, + ], + }, + { + id: "2", + warnings: [], + sentiment: "positive", + confidenceScores: { positive: 0.99, neutral: 0.01, negative: 0 }, + detectedLanguage: { name: "Japanese", iso6391Name: "ja", confidenceScore: 1 }, + isLanguageDefaulted: false, + sentences: [ + { + text: "猫は幸せ", + sentiment: "positive", + confidenceScores: { positive: 0.99, neutral: 0.01, negative: 0 }, + offset: 0, + length: 4, + opinions: [], + }, + ], + }, + ], + completedOn, + modelVersion, + }, + { + kind: "KeyPhraseExtraction", + results: [ + { + id: "0", + warnings: [], + keyPhrases: ["park"], + detectedLanguage: { name: "English", iso6391Name: "en", confidenceScore: 0.98 }, + isLanguageDefaulted: false, + }, + { + id: "1", + warnings: [], + keyPhrases: ["Español", "document"], + detectedLanguage: { name: "Spanish", iso6391Name: "es", confidenceScore: 0.75 }, + isLanguageDefaulted: false, + }, + { + id: "2", + warnings: [], + keyPhrases: [], + detectedLanguage: { name: "Japanese", iso6391Name: "ja", confidenceScore: 1 }, + isLanguageDefaulted: false, + }, + ], + completedOn, + modelVersion, + }, + { + kind: "EntityLinking", + results: [ + { + id: "0", + warnings: [], + entities: [], + detectedLanguage: { name: "English", iso6391Name: "en", confidenceScore: 0.98 }, + isLanguageDefaulted: false, + }, + { + id: "1", + error: { + code: "UnsupportedLanguageCode", + message: + "Invalid language code 'es'. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support?tabs=named-entity-recognition", + }, + }, + { + id: "2", + error: { + code: "UnsupportedLanguageCode", + message: + "Invalid language code 'ja'. Supported languages: en,es. For additional details see https://aka.ms/text-analytics/language-support?tabs=entity-linking", + }, + }, + ], + completedOn, + modelVersion, + }, + { + kind: "Healthcare", + results: [ + { + entities: [], + entityRelations: [], + id: "0", + warnings: [], + detectedLanguage: { "0": "e", "1": "n" }, + isLanguageDefaulted: false, + }, + { + id: "1", + error: { + code: "UnsupportedLanguageCode", + message: + "Invalid language code 'es'. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support", + }, + }, + { + id: "2", + error: { + code: "UnsupportedLanguageCode", + message: + "Invalid language code 'ja'. Supported languages: en. For additional details see https://aka.ms/text-analytics/language-support", + }, + }, + ], + completedOn, + modelVersion, + }, +]; + +export const expectation72: LanguageDetectionResult[] = [ + { + primaryLanguage: { name: "Hindi", iso6391Name: "hi", confidenceScore: 1, script: "Latin" }, + id: "0", + warnings: [], + }, +];