Skip to content

Commit

Permalink
record bespoke methods (#30407)
Browse files Browse the repository at this point in the history
  • Loading branch information
mssfang authored Aug 11, 2022
1 parent c8c5bf7 commit bdacef2
Show file tree
Hide file tree
Showing 10 changed files with 520 additions and 16 deletions.
3 changes: 2 additions & 1 deletion sdk/textanalytics/azure-ai-textanalytics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
<javaModulesSurefireArgLine>
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
--add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
--add-opens com.azure.ai.textanalytics/com.azure.ai.textanalytics=ALL-UNNAMED
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1218,29 +1218,20 @@ void classifyCustomMultiCategoryActionRunner(BiConsumer<List<String>, TextAnalyt

void recognizeCustomEntitiesRunner(BiConsumer<List<String>, List<String>> testRunner) {
testRunner.accept(CUSTOM_ENTITIES_INPUT,
asList(
Configuration.getGlobalConfiguration().get(AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_PROJECT_NAME),
Configuration.getGlobalConfiguration().get(AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_DEPLOYMENT_NAME))
);
asList(AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_PROJECT_NAME,
AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_DEPLOYMENT_NAME));
}

void classifyCustomSingleLabelRunner(BiConsumer<List<String>, List<String>> testRunner) {
testRunner.accept(CUSTOM_SINGLE_CLASSIFICATION,
asList(
Configuration.getGlobalConfiguration().get(
AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_PROJECT_NAME),
Configuration.getGlobalConfiguration().get(
AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_DEPLOYMENT_NAME))
);
asList(AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_PROJECT_NAME,
AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_DEPLOYMENT_NAME));
}

void classifyCustomMultiLabelRunner(BiConsumer<List<String>, List<String>> testRunner) {
testRunner.accept(CUSTOM_MULTI_CLASSIFICATION,
asList(
Configuration.getGlobalConfiguration().get(
AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_PROJECT_NAME),
Configuration.getGlobalConfiguration().get(
AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_DEPLOYMENT_NAME)));
asList(AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_PROJECT_NAME,
AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_DEPLOYMENT_NAME));
}

String getEndpoint() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"networkCallRecords" : [ {
"Method" : "POST",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs?api-version=2022-05-01",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "f53ab57a-2ef5-449f-a2c2-43f772352bc5",
"Content-Type" : "application/json"
},
"Response" : {
"content-length" : "0",
"x-envoy-upstream-service-time" : "509",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"operation-location" : "https://javatextanalyticstestresources.cognitiveservices.azure.com/language/analyze-text/jobs/fb41649a-4f2a-4a79-b2b6-3f10c8c89407?api-version=2022-05-01",
"x-content-type-options" : "nosniff",
"apim-request-id" : "079e274c-ee49-4842-8f60-232060e6b851",
"retry-after" : "0",
"StatusCode" : "202",
"Date" : "Thu, 11 Aug 2022 18:08:59 GMT"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs/fb41649a-4f2a-4a79-b2b6-3f10c8c89407?api-version=2022-05-01&showStats=false",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "5a38509b-1269-4005-8aa6-e1733abb2492"
},
"Response" : {
"content-length" : "641",
"x-envoy-upstream-service-time" : "32",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"x-content-type-options" : "nosniff",
"apim-request-id" : "1009ca9a-cce1-473b-b364-b77fbf4b35aa",
"retry-after" : "0",
"StatusCode" : "200",
"Body" : "{\"jobId\":\"fb41649a-4f2a-4a79-b2b6-3f10c8c89407\",\"lastUpdatedDateTime\":\"2022-08-11T18:09:01Z\",\"createdDateTime\":\"2022-08-11T18:09:00Z\",\"expirationDateTime\":\"2022-08-12T18:09:00Z\",\"status\":\"succeeded\",\"errors\":[],\"tasks\":{\"completed\":1,\"failed\":0,\"inProgress\":0,\"total\":1,\"items\":[{\"kind\":\"CustomMultiLabelClassificationLROResults\",\"lastUpdateDateTime\":\"2022-08-11T18:09:01.1086171Z\",\"status\":\"succeeded\",\"results\":{\"documents\":[{\"id\":\"0\",\"class\":[{\"category\":\"BookRestaurant\",\"confidenceScore\":0.97}],\"warnings\":[]}],\"errors\":[],\"projectName\":\"7cdace98-537b-494a-b69a-c19754718025\",\"deploymentName\":\"7cdace98-537b-494a-b69a-c19754718025\"}}]}}",
"Date" : "Thu, 11 Aug 2022 18:09:30 GMT",
"Content-Type" : "application/json; charset=utf-8"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs/fb41649a-4f2a-4a79-b2b6-3f10c8c89407?api-version=2022-05-01&showStats=false",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "f357d703-486b-494b-979c-9225be8da9fb"
},
"Response" : {
"content-length" : "641",
"x-envoy-upstream-service-time" : "29",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"x-content-type-options" : "nosniff",
"apim-request-id" : "638fcb1e-628f-4004-896b-88f379547935",
"retry-after" : "0",
"StatusCode" : "200",
"Body" : "{\"jobId\":\"fb41649a-4f2a-4a79-b2b6-3f10c8c89407\",\"lastUpdatedDateTime\":\"2022-08-11T18:09:01Z\",\"createdDateTime\":\"2022-08-11T18:09:00Z\",\"expirationDateTime\":\"2022-08-12T18:09:00Z\",\"status\":\"succeeded\",\"errors\":[],\"tasks\":{\"completed\":1,\"failed\":0,\"inProgress\":0,\"total\":1,\"items\":[{\"kind\":\"CustomMultiLabelClassificationLROResults\",\"lastUpdateDateTime\":\"2022-08-11T18:09:01.1086171Z\",\"status\":\"succeeded\",\"results\":{\"documents\":[{\"id\":\"0\",\"class\":[{\"category\":\"BookRestaurant\",\"confidenceScore\":0.97}],\"warnings\":[]}],\"errors\":[],\"projectName\":\"7cdace98-537b-494a-b69a-c19754718025\",\"deploymentName\":\"7cdace98-537b-494a-b69a-c19754718025\"}}]}}",
"Date" : "Thu, 11 Aug 2022 18:09:30 GMT",
"Content-Type" : "application/json; charset=utf-8"
},
"Exception" : null
} ],
"variables" : [ ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"networkCallRecords" : [ {
"Method" : "POST",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs?api-version=2022-05-01",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "8d7803d1-85bc-487f-a60e-0c3913b25be3",
"Content-Type" : "application/json"
},
"Response" : {
"content-length" : "0",
"x-envoy-upstream-service-time" : "170",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"operation-location" : "https://javatextanalyticstestresources.cognitiveservices.azure.com/language/analyze-text/jobs/6afcaf9a-b0b7-49ec-aad6-05d24abb6b36?api-version=2022-05-01",
"x-content-type-options" : "nosniff",
"apim-request-id" : "4e76b7ca-ed4d-4dae-a5b9-be205126539f",
"retry-after" : "0",
"StatusCode" : "202",
"Date" : "Thu, 11 Aug 2022 18:05:55 GMT"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs/6afcaf9a-b0b7-49ec-aad6-05d24abb6b36?api-version=2022-05-01&showStats=false",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "7402d5ee-370b-4acf-8284-2f11ca11b44f"
},
"Response" : {
"content-length" : "1244",
"x-envoy-upstream-service-time" : "29",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"x-content-type-options" : "nosniff",
"apim-request-id" : "fd61b8c1-ea70-46b7-a147-47a43896ba15",
"retry-after" : "0",
"StatusCode" : "200",
"Body" : "{\"jobId\":\"6afcaf9a-b0b7-49ec-aad6-05d24abb6b36\",\"lastUpdatedDateTime\":\"2022-08-11T18:05:56Z\",\"createdDateTime\":\"2022-08-11T18:05:55Z\",\"expirationDateTime\":\"2022-08-12T18:05:55Z\",\"status\":\"succeeded\",\"errors\":[],\"tasks\":{\"completed\":1,\"failed\":0,\"inProgress\":0,\"total\":1,\"items\":[{\"kind\":\"CustomEntityRecognitionLROResults\",\"lastUpdateDateTime\":\"2022-08-11T18:05:56.8652002Z\",\"status\":\"succeeded\",\"results\":{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"David Schmidt\",\"category\":\"artist\",\"offset\":0,\"length\":13,\"confidenceScore\":0.8},{\"text\":\"Food\",\"category\":\"service\",\"offset\":38,\"length\":4,\"confidenceScore\":0.03},{\"text\":\"Safety\",\"category\":\"geographic_poi\",\"offset\":43,\"length\":6,\"confidenceScore\":0.06},{\"text\":\"International Food\",\"category\":\"geographic_poi\",\"offset\":51,\"length\":18,\"confidenceScore\":0.07},{\"text\":\"Information Council\",\"category\":\"restaurant_name\",\"offset\":70,\"length\":19,\"confidenceScore\":0.1},{\"text\":\"IFIC\",\"category\":\"geographic_poi\",\"offset\":91,\"length\":4,\"confidenceScore\":0.05},{\"text\":\"Washington, D.C.\",\"category\":\"state\",\"offset\":98,\"length\":16,\"confidenceScore\":0.49}],\"warnings\":[]}],\"errors\":[],\"projectName\":\"88ee0f78-fbca-444d-98e2-7c4c8631e494\",\"deploymentName\":\"88ee0f78-fbca-444d-98e2-7c4c8631e494\"}}]}}",
"Date" : "Thu, 11 Aug 2022 18:06:26 GMT",
"Content-Type" : "application/json; charset=utf-8"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs/6afcaf9a-b0b7-49ec-aad6-05d24abb6b36?api-version=2022-05-01&showStats=false",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "754aeb4b-8f66-441c-aeb6-2dedf7a28b3f"
},
"Response" : {
"content-length" : "1244",
"x-envoy-upstream-service-time" : "34",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"x-content-type-options" : "nosniff",
"apim-request-id" : "30705a54-2950-4769-820f-faa508086405",
"retry-after" : "0",
"StatusCode" : "200",
"Body" : "{\"jobId\":\"6afcaf9a-b0b7-49ec-aad6-05d24abb6b36\",\"lastUpdatedDateTime\":\"2022-08-11T18:05:56Z\",\"createdDateTime\":\"2022-08-11T18:05:55Z\",\"expirationDateTime\":\"2022-08-12T18:05:55Z\",\"status\":\"succeeded\",\"errors\":[],\"tasks\":{\"completed\":1,\"failed\":0,\"inProgress\":0,\"total\":1,\"items\":[{\"kind\":\"CustomEntityRecognitionLROResults\",\"lastUpdateDateTime\":\"2022-08-11T18:05:56.8652002Z\",\"status\":\"succeeded\",\"results\":{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"David Schmidt\",\"category\":\"artist\",\"offset\":0,\"length\":13,\"confidenceScore\":0.8},{\"text\":\"Food\",\"category\":\"service\",\"offset\":38,\"length\":4,\"confidenceScore\":0.03},{\"text\":\"Safety\",\"category\":\"geographic_poi\",\"offset\":43,\"length\":6,\"confidenceScore\":0.06},{\"text\":\"International Food\",\"category\":\"geographic_poi\",\"offset\":51,\"length\":18,\"confidenceScore\":0.07},{\"text\":\"Information Council\",\"category\":\"restaurant_name\",\"offset\":70,\"length\":19,\"confidenceScore\":0.1},{\"text\":\"IFIC\",\"category\":\"geographic_poi\",\"offset\":91,\"length\":4,\"confidenceScore\":0.05},{\"text\":\"Washington, D.C.\",\"category\":\"state\",\"offset\":98,\"length\":16,\"confidenceScore\":0.49}],\"warnings\":[]}],\"errors\":[],\"projectName\":\"88ee0f78-fbca-444d-98e2-7c4c8631e494\",\"deploymentName\":\"88ee0f78-fbca-444d-98e2-7c4c8631e494\"}}]}}",
"Date" : "Thu, 11 Aug 2022 18:06:26 GMT",
"Content-Type" : "application/json; charset=utf-8"
},
"Exception" : null
} ],
"variables" : [ ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"networkCallRecords" : [ {
"Method" : "POST",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs?api-version=2022-05-01",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "3728deb8-b063-4111-88ed-c628b0bce3dd",
"Content-Type" : "application/json"
},
"Response" : {
"content-length" : "0",
"x-envoy-upstream-service-time" : "290",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"operation-location" : "https://javatextanalyticstestresources.cognitiveservices.azure.com/language/analyze-text/jobs/1a90b5ad-b82f-455b-bd16-d403a61fc50c?api-version=2022-05-01",
"x-content-type-options" : "nosniff",
"apim-request-id" : "68cd0b13-4280-4430-80ec-2366057e4a4b",
"retry-after" : "0",
"StatusCode" : "202",
"Date" : "Thu, 11 Aug 2022 18:03:52 GMT"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs/1a90b5ad-b82f-455b-bd16-d403a61fc50c?api-version=2022-05-01&showStats=false",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "c3912c8e-c9a9-40f2-bc67-7d28d8d4e86b"
},
"Response" : {
"content-length" : "636",
"x-envoy-upstream-service-time" : "34",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"x-content-type-options" : "nosniff",
"apim-request-id" : "06d5f923-2280-43da-ad5e-a1a98932350c",
"retry-after" : "0",
"StatusCode" : "200",
"Body" : "{\"jobId\":\"1a90b5ad-b82f-455b-bd16-d403a61fc50c\",\"lastUpdatedDateTime\":\"2022-08-11T18:03:53Z\",\"createdDateTime\":\"2022-08-11T18:03:53Z\",\"expirationDateTime\":\"2022-08-12T18:03:53Z\",\"status\":\"succeeded\",\"errors\":[],\"tasks\":{\"completed\":1,\"failed\":0,\"inProgress\":0,\"total\":1,\"items\":[{\"kind\":\"CustomSingleLabelClassificationLROResults\",\"lastUpdateDateTime\":\"2022-08-11T18:03:53.8508332Z\",\"status\":\"succeeded\",\"results\":{\"documents\":[{\"id\":\"0\",\"class\":[{\"category\":\"RateBook\",\"confidenceScore\":0.76}],\"warnings\":[]}],\"errors\":[],\"projectName\":\"659c1851-be0b-4142-b12a-087da9785926\",\"deploymentName\":\"659c1851-be0b-4142-b12a-087da9785926\"}}]}}",
"Date" : "Thu, 11 Aug 2022 18:04:23 GMT",
"Content-Type" : "application/json; charset=utf-8"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.cognitiveservices.azure.com/language/analyze-text/jobs/1a90b5ad-b82f-455b-bd16-d403a61fc50c?api-version=2022-05-01&showStats=false",
"Headers" : {
"User-Agent" : "azsdk-java-azure-ai-textanalytics/5.2.0-beta.4 (11.0.10; Windows 10; 10.0)",
"x-ms-client-request-id" : "00d6c217-accd-4c11-9780-e7e6831794f8"
},
"Response" : {
"content-length" : "636",
"x-envoy-upstream-service-time" : "29",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload",
"x-content-type-options" : "nosniff",
"apim-request-id" : "c1ea8292-4a27-4811-a3c6-820ada5964b2",
"retry-after" : "0",
"StatusCode" : "200",
"Body" : "{\"jobId\":\"1a90b5ad-b82f-455b-bd16-d403a61fc50c\",\"lastUpdatedDateTime\":\"2022-08-11T18:03:53Z\",\"createdDateTime\":\"2022-08-11T18:03:53Z\",\"expirationDateTime\":\"2022-08-12T18:03:53Z\",\"status\":\"succeeded\",\"errors\":[],\"tasks\":{\"completed\":1,\"failed\":0,\"inProgress\":0,\"total\":1,\"items\":[{\"kind\":\"CustomSingleLabelClassificationLROResults\",\"lastUpdateDateTime\":\"2022-08-11T18:03:53.8508332Z\",\"status\":\"succeeded\",\"results\":{\"documents\":[{\"id\":\"0\",\"class\":[{\"category\":\"RateBook\",\"confidenceScore\":0.76}],\"warnings\":[]}],\"errors\":[],\"projectName\":\"659c1851-be0b-4142-b12a-087da9785926\",\"deploymentName\":\"659c1851-be0b-4142-b12a-087da9785926\"}}]}}",
"Date" : "Thu, 11 Aug 2022 18:04:23 GMT",
"Content-Type" : "application/json; charset=utf-8"
},
"Exception" : null
} ],
"variables" : [ ]
}
Loading

0 comments on commit bdacef2

Please sign in to comment.