Source:
<code>public static void main(String[] args) { TextAnalyticsClient client = new TextAnalyticsClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("{endpoint}") .buildClient(); List<String> documents = Arrays.asList( "Old Faithful is a geyser at Yellowstone Park.", "Mount Shasta has lenticular clouds." ); AtomicInteger counter = new AtomicInteger(); <START> for (RecognizeLinkedEntitiesResult entitiesResult : client.recognizeLinkedEntitiesBatch(documents, "en", null)) { <END> System.out.printf("%nText = %s%n", documents.get(counter.getAndIncrement())); if (entitiesResult.isError()) { System.out.printf("Cannot recognize linked entities. Error: %s%n", entitiesResult.getError().getMessage()); } else { entitiesResult.getEntities().forEach(entity -> { System.out.println("Linked Entities:"); System.out.printf("\tName: %s, entity ID in data source: %s, URL: %s, data source: %s.%n", entity.getName(), entity.getDataSourceEntityId(), entity.getUrl(), entity.getDataSource()); entity.getMatches().forEach(entityMatch -> System.out.printf( "\tMatched entity: %s, confidence score: %f.%n", entityMatch.getText(), entityMatch.getConfidenceScore())); }); } } }</code><technical_language>good show examples valid TextAnalyticsRequestOptions options other overload</technical_language>

Target:
public static void main(String[] args) { TextAnalyticsClient client = new TextAnalyticsClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("{endpoint}") .buildClient(); List<String> documents = Arrays.asList( "Old Faithful is a geyser at Yellowstone Park.", "Mount Shasta has lenticular clouds." ); TextAnalyticsRequestOptions requestOptions = new TextAnalyticsRequestOptions().setIncludeStatistics(true).setModelVersion("latest"); RecognizeLinkedEntitiesResultCollection linkedEntitiesResultCollection = client.recognizeLinkedEntitiesBatch(documents, "en", requestOptions); System.out.printf("Results of Azure Text Analytics \"Linked Entities Recognition\" Model, version: %s%n", linkedEntitiesResultCollection.getModelVersion()); TextDocumentBatchStatistics batchStatistics = linkedEntitiesResultCollection.getStatistics(); System.out.printf("Documents statistics: document count = %s, erroneous document count = %s, transaction count = %s, valid document count = %s.%n", batchStatistics.getDocumentCount(), batchStatistics.getInvalidDocumentCount(), batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); AtomicInteger counter = new AtomicInteger(); for (RecognizeLinkedEntitiesResult entitiesResult : linkedEntitiesResultCollection) { System.out.printf("%nText = %s%n", documents.get(counter.getAndIncrement())); if (entitiesResult.isError()) { System.out.printf("Cannot recognize linked entities. Error: %s%n", entitiesResult.getError().getMessage()); } else { entitiesResult.getEntities().forEach(entity -> { System.out.println("Linked Entities:"); System.out.printf("\tName: %s, entity ID in data source: %s, URL: %s, data source: %s.%n", entity.getName(), entity.getDataSourceEntityId(), entity.getUrl(), entity.getDataSource()); entity.getMatches().forEach(entityMatch -> System.out.printf( "\tMatched entity: %s, confidence score: %f.%n", entityMatch.getText(), entityMatch.getConfidenceScore())); }); } } }