azure-docs-sdk-java/docs-ref-autogen/com.azure.ai.textanalytics....

1001 строка
271 KiB
YAML
Исходник Постоянная ссылка Ответственный История

### YamlMime:JavaType
uid: "com.azure.ai.textanalytics.TextAnalyticsClient"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient"
name: "TextAnalyticsClient"
nameWithType: "TextAnalyticsClient"
summary: "This class provides a synchronous client that contains all the operations that apply to Azure Text Analytics."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **TextAnalyticsClient**"
methods:
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment(java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment(String document)"
name: "analyzeSentiment(String document)"
nameWithType: "TextAnalyticsClient.analyzeSentiment(String document)"
summary: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it."
parameters:
- description: "The document to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public DocumentSentiment analyzeSentiment(String document)"
desc: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it. This method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\nAnalyze the sentiments of documents\n\n```java\nDocumentSentiment documentSentiment =\n textAnalyticsClient.analyzeSentiment(\"The hotel was dark and unclean.\");\n\n System.out.printf(\n \"Recognized sentiment: %s, positive score: %.2f, neutral score: %.2f, negative score: %.2f.%n\",\n documentSentiment.getSentiment(),\n documentSentiment.getConfidenceScores().getPositive(),\n documentSentiment.getConfidenceScores().getNeutral(),\n documentSentiment.getConfidenceScores().getNegative());\n\n for (SentenceSentiment sentenceSentiment : documentSentiment.getSentences()) {\n System.out.printf(\n \"Recognized sentence sentiment: %s, positive score: %.2f, neutral score: %.2f, negative score: %.2f.%n\",\n sentenceSentiment.getSentiment(),\n sentenceSentiment.getConfidenceScores().getPositive(),\n sentenceSentiment.getConfidenceScores().getNeutral(),\n sentenceSentiment.getConfidenceScores().getNegative());\n }\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.DocumentSentiment\" data-throw-if-not-resolved=\"false\" data-raw-source=\"analyzed document sentiment\"></xref> of the document."
type: "<xref href=\"com.azure.ai.textanalytics.models.DocumentSentiment?alt=com.azure.ai.textanalytics.models.DocumentSentiment&text=DocumentSentiment\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment(String document, String language)"
name: "analyzeSentiment(String document, String language)"
nameWithType: "TextAnalyticsClient.analyzeSentiment(String document, String language)"
summary: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it."
parameters:
- description: "The document to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2 letter ISO 639-1 representation of language for the document. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public DocumentSentiment analyzeSentiment(String document, String language)"
desc: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it.\n\n**Code Sample**\n\nAnalyze the sentiments in a document with a provided language representation.\n\n```java\nDocumentSentiment documentSentiment = textAnalyticsClient.analyzeSentiment(\n \"The hotel was dark and unclean.\", \"en\");\n\n System.out.printf(\n \"Recognized sentiment: %s, positive score: %.2f, neutral score: %.2f, negative score: %.2f.%n\",\n documentSentiment.getSentiment(),\n documentSentiment.getConfidenceScores().getPositive(),\n documentSentiment.getConfidenceScores().getNeutral(),\n documentSentiment.getConfidenceScores().getNegative());\n\n for (SentenceSentiment sentenceSentiment : documentSentiment.getSentences()) {\n System.out.printf(\n \"Recognized sentence sentiment: %s, positive score: %.2f, neutral score: %.2f, negative score: %.2f.%n\",\n sentenceSentiment.getSentiment(),\n sentenceSentiment.getConfidenceScores().getPositive(),\n sentenceSentiment.getConfidenceScores().getNeutral(),\n sentenceSentiment.getConfidenceScores().getNegative());\n }\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.DocumentSentiment\" data-throw-if-not-resolved=\"false\" data-raw-source=\"analyzed document sentiment\"></xref> of the document."
type: "<xref href=\"com.azure.ai.textanalytics.models.DocumentSentiment?alt=com.azure.ai.textanalytics.models.DocumentSentiment&text=DocumentSentiment\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment(java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.AnalyzeSentimentOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment(String document, String language, AnalyzeSentimentOptions options)"
name: "analyzeSentiment(String document, String language, AnalyzeSentimentOptions options)"
nameWithType: "TextAnalyticsClient.analyzeSentiment(String document, String language, AnalyzeSentimentOptions options)"
summary: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it."
parameters:
- description: "The document to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2 letter ISO 639-1 representation of language for the document. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n analyzing sentiments."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions?alt=com.azure.ai.textanalytics.models.AnalyzeSentimentOptions&text=AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DocumentSentiment analyzeSentiment(String document, String language, AnalyzeSentimentOptions options)"
desc: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it. If the `includeOpinionMining` of <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentOptions\"></xref> set to true, the output will include the opinion mining results. It mines the opinions of a sentence and conducts more granular analysis around the aspects in the text (also known as aspect-based sentiment analysis).\n\n**Code Sample**\n\nAnalyze the sentiment and mine the opinions for each sentence in a document with a provided language representation and <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentOptions\"></xref> options.\n\n```java\nDocumentSentiment documentSentiment = textAnalyticsClient.analyzeSentiment(\n \"The hotel was dark and unclean.\", \"en\",\n new AnalyzeSentimentOptions().setIncludeOpinionMining(true));\n for (SentenceSentiment sentenceSentiment : documentSentiment.getSentences()) {\n System.out.printf(\"\\tSentence sentiment: %s%n\", sentenceSentiment.getSentiment());\n sentenceSentiment.getOpinions().forEach(opinion -> {\n TargetSentiment targetSentiment = opinion.getTarget();\n System.out.printf(\"\\tTarget sentiment: %s, target text: %s%n\", targetSentiment.getSentiment(),\n targetSentiment.getText());\n for (AssessmentSentiment assessmentSentiment : opinion.getAssessments()) {\n System.out.printf(\"\\t\\t'%s' sentiment because of \\\"%s\\\". Is the assessment negated: %s.%n\",\n assessmentSentiment.getSentiment(), assessmentSentiment.getText(), assessmentSentiment.isNegated());\n }\n });\n }\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.DocumentSentiment\" data-throw-if-not-resolved=\"false\" data-raw-source=\"analyzed document sentiment\"></xref> of the document."
type: "<xref href=\"com.azure.ai.textanalytics.models.DocumentSentiment?alt=com.azure.ai.textanalytics.models.DocumentSentiment&text=DocumentSentiment\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.AnalyzeSentimentOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatch(Iterable<String> documents, String language, AnalyzeSentimentOptions options)"
name: "analyzeSentimentBatch(Iterable<String> documents, String language, AnalyzeSentimentOptions options)"
nameWithType: "TextAnalyticsClient.analyzeSentimentBatch(Iterable<String> documents, String language, AnalyzeSentimentOptions options)"
summary: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2 letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n analyzing sentiments."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions?alt=com.azure.ai.textanalytics.models.AnalyzeSentimentOptions&text=AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public AnalyzeSentimentResultCollection analyzeSentimentBatch(Iterable<String> documents, String language, AnalyzeSentimentOptions options)"
desc: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it. If the `includeOpinionMining` of <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentOptions\"></xref> set to true, the output will include the opinion mining results. It mines the opinions of a sentence and conducts more granular analysis around the aspects in the text (also known as aspect-based sentiment analysis).\n\n**Code Sample**\n\nAnalyze the sentiments and mine the opinions for each sentence in a list of documents with a provided language representation and <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentOptions\"></xref> options.\n\n```java\nList<String> documents = Arrays.asList(\n \"The hotel was dark and unclean. The restaurant had amazing gnocchi.\",\n \"The restaurant had amazing gnocchi. The hotel was dark and unclean.\"\n );\n\n // Analyzing batch sentiments\n AnalyzeSentimentResultCollection resultCollection = textAnalyticsClient.analyzeSentimentBatch(\n documents, \"en\", new AnalyzeSentimentOptions().setIncludeOpinionMining(true));\n\n // Analyzed sentiment for each of documents from a batch of documents\n resultCollection.forEach(analyzeSentimentResult -> {\n System.out.printf(\"Document ID: %s%n\", analyzeSentimentResult.getId());\n DocumentSentiment documentSentiment = analyzeSentimentResult.getDocumentSentiment();\n documentSentiment.getSentences().forEach(sentenceSentiment -> {\n System.out.printf(\"\\tSentence sentiment: %s%n\", sentenceSentiment.getSentiment());\n sentenceSentiment.getOpinions().forEach(opinion -> {\n TargetSentiment targetSentiment = opinion.getTarget();\n System.out.printf(\"\\tTarget sentiment: %s, target text: %s%n\", targetSentiment.getSentiment(),\n targetSentiment.getText());\n for (AssessmentSentiment assessmentSentiment : opinion.getAssessments()) {\n System.out.printf(\"\\t\\t'%s' sentiment because of \\\"%s\\\". Is the assessment negated: %s.%n\",\n assessmentSentiment.getSentiment(), assessmentSentiment.getText(), assessmentSentiment.isNegated());\n }\n });\n });\n });\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentResultCollection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection?alt=com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection&text=AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
name: "analyzeSentimentBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
nameWithType: "TextAnalyticsClient.analyzeSentimentBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
summary: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it."
deprecatedTag: "Please use the <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.AnalyzeSentimentOptions)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#analyzeSentimentBatch(Iterable, String, AnalyzeSentimentOptions)\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2 letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public AnalyzeSentimentResultCollection analyzeSentimentBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
desc: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it.\n\n**Code Sample**\n\nAnalyze the sentiments in a list of documents with a provided language representation and request options.\n\n```java\nList<String> documents = Arrays.asList(\n \"The hotel was dark and unclean. The restaurant had amazing gnocchi.\",\n \"The restaurant had amazing gnocchi. The hotel was dark and unclean.\"\n );\n\n // Analyzing batch sentiments\n AnalyzeSentimentResultCollection resultCollection = textAnalyticsClient.analyzeSentimentBatch(\n documents, \"en\", new TextAnalyticsRequestOptions().setIncludeStatistics(true));\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n // Analyzed sentiment for each of documents from a batch of documents\n resultCollection.forEach(analyzeSentimentResult -> {\n System.out.printf(\"Document ID: %s%n\", analyzeSentimentResult.getId());\n // Valid document\n DocumentSentiment documentSentiment = analyzeSentimentResult.getDocumentSentiment();\n System.out.printf(\n \"Recognized document sentiment: %s, positive score: %.2f, neutral score: %.2f,\"\n + \" negative score: %.2f.%n\",\n documentSentiment.getSentiment(),\n documentSentiment.getConfidenceScores().getPositive(),\n documentSentiment.getConfidenceScores().getNeutral(),\n documentSentiment.getConfidenceScores().getNegative());\n documentSentiment.getSentences().forEach(sentenceSentiment -> System.out.printf(\n \"Recognized sentence sentiment: %s, positive score: %.2f, neutral score: %.2f,\"\n + \" negative score: %.2f.%n\",\n sentenceSentiment.getSentiment(),\n sentenceSentiment.getConfidenceScores().getPositive(),\n sentenceSentiment.getConfidenceScores().getNeutral(),\n sentenceSentiment.getConfidenceScores().getNegative()));\n });\n```"
hasDeprecatedTag: true
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentResultCollection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection?alt=com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection&text=AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.AnalyzeSentimentOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, AnalyzeSentimentOptions options, Context context)"
name: "analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, AnalyzeSentimentOptions options, Context context)"
nameWithType: "TextAnalyticsClient.analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, AnalyzeSentimentOptions options, Context context)"
summary: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n analyzing sentiments."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions?alt=com.azure.ai.textanalytics.models.AnalyzeSentimentOptions&text=AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<AnalyzeSentimentResultCollection> analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, AnalyzeSentimentOptions options, Context context)"
desc: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it. If the `includeOpinionMining` of <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentOptions\"></xref> set to true, the output will include the opinion mining results. It mines the opinions of a sentence and conducts more granular analysis around the aspects in the text (also known as aspect-based sentiment analysis).\n\n**Code Sample**\n\nAnalyze sentiment and mine the opinions for each sentence in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentOptions\"></xref> options.\n\n```java\nList<TextDocumentInput> textDocumentInputs = Arrays.asList(\n new TextDocumentInput(\"1\", \"The hotel was dark and unclean. The restaurant had amazing gnocchi.\")\n .setLanguage(\"en\"),\n new TextDocumentInput(\"2\", \"The restaurant had amazing gnocchi. The hotel was dark and unclean.\")\n .setLanguage(\"en\")\n );\n\n AnalyzeSentimentOptions options = new AnalyzeSentimentOptions().setIncludeOpinionMining(true)\n .setIncludeStatistics(true);\n\n // Analyzing batch sentiments\n Response<AnalyzeSentimentResultCollection> response =\n textAnalyticsClient.analyzeSentimentBatchWithResponse(textDocumentInputs, options, Context.NONE);\n\n // Response's status code\n System.out.printf(\"Status code of request response: %d%n\", response.getStatusCode());\n AnalyzeSentimentResultCollection resultCollection = response.getValue();\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n // Analyzed sentiment for each of documents from a batch of documents\n resultCollection.forEach(analyzeSentimentResult -> {\n System.out.printf(\"Document ID: %s%n\", analyzeSentimentResult.getId());\n DocumentSentiment documentSentiment = analyzeSentimentResult.getDocumentSentiment();\n documentSentiment.getSentences().forEach(sentenceSentiment -> {\n System.out.printf(\"\\tSentence sentiment: %s%n\", sentenceSentiment.getSentiment());\n sentenceSentiment.getOpinions().forEach(opinion -> {\n TargetSentiment targetSentiment = opinion.getTarget();\n System.out.printf(\"\\tTarget sentiment: %s, target text: %s%n\", targetSentiment.getSentiment(),\n targetSentiment.getText());\n for (AssessmentSentiment assessmentSentiment : opinion.getAssessments()) {\n System.out.printf(\"\\t\\t'%s' sentiment because of \\\"%s\\\". Is the assessment negated: %s.%n\",\n assessmentSentiment.getSentiment(), assessmentSentiment.getText(),\n assessmentSentiment.isNegated());\n }\n });\n });\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> that contains a <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection?alt=com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection&text=AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
name: "analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
nameWithType: "TextAnalyticsClient.analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
summary: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it."
deprecatedTag: "Please use the <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentimentBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.AnalyzeSentimentOptions,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#analyzeSentimentBatchWithResponse(Iterable, AnalyzeSentimentOptions, Context)\"></xref>."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public Response<AnalyzeSentimentResultCollection> analyzeSentimentBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
desc: "Returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it.\n\n**Code Sample**\n\nAnalyze sentiment in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\n```java\nList<TextDocumentInput> textDocumentInputs = Arrays.asList(\n new TextDocumentInput(\"1\", \"The hotel was dark and unclean. The restaurant had amazing gnocchi.\")\n .setLanguage(\"en\"),\n new TextDocumentInput(\"2\", \"The restaurant had amazing gnocchi. The hotel was dark and unclean.\")\n .setLanguage(\"en\")\n );\n\n // Analyzing batch sentiments\n Response<AnalyzeSentimentResultCollection> response =\n textAnalyticsClient.analyzeSentimentBatchWithResponse(textDocumentInputs,\n new TextAnalyticsRequestOptions().setIncludeStatistics(true), Context.NONE);\n\n // Response's status code\n System.out.printf(\"Status code of request response: %d%n\", response.getStatusCode());\n AnalyzeSentimentResultCollection resultCollection = response.getValue();\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n // Analyzed sentiment for each of documents from a batch of documents\n resultCollection.forEach(analyzeSentimentResult -> {\n System.out.printf(\"Document ID: %s%n\", analyzeSentimentResult.getId());\n // Valid document\n DocumentSentiment documentSentiment = analyzeSentimentResult.getDocumentSentiment();\n System.out.printf(\n \"Recognized document sentiment: %s, positive score: %.2f, neutral score: %.2f, \"\n + \"negative score: %.2f.%n\",\n documentSentiment.getSentiment(),\n documentSentiment.getConfidenceScores().getPositive(),\n documentSentiment.getConfidenceScores().getNeutral(),\n documentSentiment.getConfidenceScores().getNegative());\n documentSentiment.getSentences().forEach(sentenceSentiment -> {\n System.out.printf(\n \"Recognized sentence sentiment: %s, positive score: %.2f, neutral score: %.2f,\"\n + \" negative score: %.2f.%n\",\n sentenceSentiment.getSentiment(),\n sentenceSentiment.getConfidenceScores().getPositive(),\n sentenceSentiment.getConfidenceScores().getNeutral(),\n sentenceSentiment.getConfidenceScores().getNegative());\n });\n });\n```"
hasDeprecatedTag: true
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> that contains a <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection?alt=com.azure.ai.textanalytics.util.AnalyzeSentimentResultCollection&text=AnalyzeSentimentResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAbstractSummary(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.AbstractiveSummaryOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAbstractSummary(Iterable<TextDocumentInput> documents, AbstractiveSummaryOptions options, Context context)"
name: "beginAbstractSummary(Iterable<TextDocumentInput> documents, AbstractiveSummaryOptions options, Context context)"
nameWithType: "TextAnalyticsClient.beginAbstractSummary(Iterable<TextDocumentInput> documents, AbstractiveSummaryOptions options, Context context)"
summary: "Returns a list of abstractive summary for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AbstractiveSummaryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing abstractive summarization."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AbstractiveSummaryOptions?alt=com.azure.ai.textanalytics.models.AbstractiveSummaryOptions&text=AbstractiveSummaryOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<AbstractiveSummaryOperationDetail,AbstractiveSummaryPagedIterable> beginAbstractSummary(Iterable<TextDocumentInput> documents, AbstractiveSummaryOptions options, Context context)"
desc: "Returns a list of abstractive summary for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2023_04_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2023_04_01\"></xref>.\n\n**Code Sample**\n\n```java\nList<TextDocumentInput> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(new TextDocumentInput(Integer.toString(i),\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\"));\n }\n SyncPoller<AbstractiveSummaryOperationDetail, AbstractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginAbstractSummary(documents,\n new AbstractiveSummaryOptions().setDisplayName(\"{tasks_display_name}\").setSentenceCount(3),\n Context.NONE);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (AbstractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tAbstractive summary sentences:\");\n for (AbstractiveSummary summarySentence : documentResult.getSummaries()) {\n System.out.printf(\"\\t\\t Summary text: %s.%n\", summarySentence.getText());\n for (AbstractiveSummaryContext abstractiveSummaryContext : summarySentence.getContexts()) {\n System.out.printf(\"\\t\\t offset: %d, length: %d%n\",\n abstractiveSummaryContext.getOffset(), abstractiveSummaryContext.getLength());\n }\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the abstractive summarization operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.AbstractiveSummaryResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AbstractiveSummaryResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AbstractiveSummaryOperationDetail?alt=com.azure.ai.textanalytics.models.AbstractiveSummaryOperationDetail&text=AbstractiveSummaryOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AbstractiveSummaryPagedIterable?alt=com.azure.ai.textanalytics.util.AbstractiveSummaryPagedIterable&text=AbstractiveSummaryPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAbstractSummary(java.lang.Iterable<java.lang.String>)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAbstractSummary(Iterable<String> documents)"
name: "beginAbstractSummary(Iterable<String> documents)"
nameWithType: "TextAnalyticsClient.beginAbstractSummary(Iterable<String> documents)"
summary: "Returns a list of abstractive summary for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>.."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public SyncPoller<AbstractiveSummaryOperationDetail,AbstractiveSummaryPagedIterable> beginAbstractSummary(Iterable<String> documents)"
desc: "Returns a list of abstractive summary for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2023_04_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2023_04_01\"></xref>.\n\nThis method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\");\n }\n SyncPoller<AbstractiveSummaryOperationDetail, AbstractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginAbstractSummary(documents);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (AbstractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tAbstractive summary sentences:\");\n for (AbstractiveSummary summarySentence : documentResult.getSummaries()) {\n System.out.printf(\"\\t\\t Summary text: %s.%n\", summarySentence.getText());\n for (AbstractiveSummaryContext abstractiveSummaryContext : summarySentence.getContexts()) {\n System.out.printf(\"\\t\\t offset: %d, length: %d%n\",\n abstractiveSummaryContext.getOffset(), abstractiveSummaryContext.getLength());\n }\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the abstractive summarization operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.AbstractiveSummaryResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AbstractiveSummaryResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AbstractiveSummaryOperationDetail?alt=com.azure.ai.textanalytics.models.AbstractiveSummaryOperationDetail&text=AbstractiveSummaryOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AbstractiveSummaryPagedIterable?alt=com.azure.ai.textanalytics.util.AbstractiveSummaryPagedIterable&text=AbstractiveSummaryPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAbstractSummary(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.AbstractiveSummaryOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAbstractSummary(Iterable<String> documents, String language, AbstractiveSummaryOptions options)"
name: "beginAbstractSummary(Iterable<String> documents, String language, AbstractiveSummaryOptions options)"
nameWithType: "TextAnalyticsClient.beginAbstractSummary(Iterable<String> documents, String language, AbstractiveSummaryOptions options)"
summary: "Returns a list of abstractive summary for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2-letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AbstractiveSummaryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing abstractive summarization."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AbstractiveSummaryOptions?alt=com.azure.ai.textanalytics.models.AbstractiveSummaryOptions&text=AbstractiveSummaryOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<AbstractiveSummaryOperationDetail,AbstractiveSummaryPagedIterable> beginAbstractSummary(Iterable<String> documents, String language, AbstractiveSummaryOptions options)"
desc: "Returns a list of abstractive summary for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\nSee [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\");\n }\n SyncPoller<AbstractiveSummaryOperationDetail, AbstractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginAbstractSummary(documents, \"en\",\n new AbstractiveSummaryOptions().setDisplayName(\"{tasks_display_name}\").setSentenceCount(3));\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (AbstractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tAbstractive summary sentences:\");\n for (AbstractiveSummary summarySentence : documentResult.getSummaries()) {\n System.out.printf(\"\\t\\t Summary text: %s.%n\", summarySentence.getText());\n for (AbstractiveSummaryContext abstractiveSummaryContext : summarySentence.getContexts()) {\n System.out.printf(\"\\t\\t offset: %d, length: %d%n\",\n abstractiveSummaryContext.getOffset(), abstractiveSummaryContext.getLength());\n }\n }\n }\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the abstractive summarization operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.AbstractiveSummaryResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AbstractiveSummaryResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AbstractiveSummaryOperationDetail?alt=com.azure.ai.textanalytics.models.AbstractiveSummaryOperationDetail&text=AbstractiveSummaryOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AbstractiveSummaryPagedIterable?alt=com.azure.ai.textanalytics.util.AbstractiveSummaryPagedIterable&text=AbstractiveSummaryPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeActions(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.TextAnalyticsActions,com.azure.ai.textanalytics.models.AnalyzeActionsOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeActions(Iterable<TextDocumentInput> documents, TextAnalyticsActions actions, AnalyzeActionsOptions options, Context context)"
name: "beginAnalyzeActions(Iterable<TextDocumentInput> documents, TextAnalyticsActions actions, AnalyzeActionsOptions options, Context context)"
nameWithType: "TextAnalyticsClient.beginAnalyzeActions(Iterable<TextDocumentInput> documents, TextAnalyticsActions actions, AnalyzeActionsOptions options, Context context)"
summary: "Execute actions, such as, entities recognition, PII entities recognition and key phrases extraction for a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> with provided request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsActions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"actions\"></xref> that contains all actions to be executed.\n An action is one task of execution, such as a single task of 'Key Phrases Extraction' on the given document\n inputs."
name: "actions"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsActions?alt=com.azure.ai.textanalytics.models.TextAnalyticsActions&text=TextAnalyticsActions\" data-throw-if-not-resolved=\"False\" />"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeActionsOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n analyzing a collection of actions."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AnalyzeActionsOptions?alt=com.azure.ai.textanalytics.models.AnalyzeActionsOptions&text=AnalyzeActionsOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<AnalyzeActionsOperationDetail,AnalyzeActionsResultPagedIterable> beginAnalyzeActions(Iterable<TextDocumentInput> documents, TextAnalyticsActions actions, AnalyzeActionsOptions options, Context context)"
desc: "Execute actions, such as, entities recognition, PII entities recognition and key phrases extraction for a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> with provided request options. See [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<TextDocumentInput> documents = Arrays.asList(\n new TextDocumentInput(\"0\", \"Elon Musk is the CEO of SpaceX and Tesla.\").setLanguage(\"en\"),\n new TextDocumentInput(\"1\", \"My SSN is 859-98-0987\").setLanguage(\"en\")\n );\n\n SyncPoller<AnalyzeActionsOperationDetail, AnalyzeActionsResultPagedIterable> syncPoller =\n textAnalyticsClient.beginAnalyzeActions(\n documents,\n new TextAnalyticsActions().setDisplayName(\"{tasks_display_name}\")\n .setRecognizeEntitiesActions(new RecognizeEntitiesAction())\n .setExtractKeyPhrasesActions(new ExtractKeyPhrasesAction()),\n new AnalyzeActionsOptions().setIncludeStatistics(false),\n Context.NONE);\n syncPoller.waitForCompletion();\n AnalyzeActionsResultPagedIterable result = syncPoller.getFinalResult();\n result.forEach(analyzeActionsResult -> {\n System.out.println(\"Entities recognition action results:\");\n analyzeActionsResult.getRecognizeEntitiesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(\n entitiesResult -> entitiesResult.getEntities().forEach(\n entity -> System.out.printf(\n \"Recognized entity: %s, entity category: %s, entity subcategory: %s,\"\n + \" confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(),\n entity.getConfidenceScore())));\n }\n });\n System.out.println(\"Key phrases extraction action results:\");\n analyzeActionsResult.getExtractKeyPhrasesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(extractKeyPhraseResult -> {\n System.out.println(\"Extracted phrases:\");\n extractKeyPhraseResult.getKeyPhrases()\n .forEach(keyPhrases -> System.out.printf(\"\\t%s.%n\", keyPhrases));\n });\n }\n });\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the analyze a collection of actions operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeActionsResultPagedIterable\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AnalyzeActionsOperationDetail?alt=com.azure.ai.textanalytics.models.AnalyzeActionsOperationDetail&text=AnalyzeActionsOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable?alt=com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable&text=AnalyzeActionsResultPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeActions(java.lang.Iterable<java.lang.String>,com.azure.ai.textanalytics.models.TextAnalyticsActions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions)"
name: "beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions)"
nameWithType: "TextAnalyticsClient.beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions)"
summary: "Execute actions, such as, entities recognition, PII entities recognition and key phrases extraction for a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsActions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"actions\"></xref> that contains all actions to be executed.\n An action is one task of execution, such as a single task of 'Key Phrases Extraction' on the given document\n inputs."
name: "actions"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsActions?alt=com.azure.ai.textanalytics.models.TextAnalyticsActions&text=TextAnalyticsActions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<AnalyzeActionsOperationDetail,AnalyzeActionsResultPagedIterable> beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions)"
desc: "Execute actions, such as, entities recognition, PII entities recognition and key phrases extraction for a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref>. This method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\n```java\nList<String> documents = Arrays.asList(\n \"Elon Musk is the CEO of SpaceX and Tesla.\",\n \"My SSN is 859-98-0987\"\n );\n\n SyncPoller<AnalyzeActionsOperationDetail, AnalyzeActionsResultPagedIterable> syncPoller =\n textAnalyticsClient.beginAnalyzeActions(\n documents,\n new TextAnalyticsActions().setDisplayName(\"{tasks_display_name}\")\n .setRecognizeEntitiesActions(new RecognizeEntitiesAction())\n .setExtractKeyPhrasesActions(new ExtractKeyPhrasesAction()));\n syncPoller.waitForCompletion();\n AnalyzeActionsResultPagedIterable result = syncPoller.getFinalResult();\n result.forEach(analyzeActionsResult -> {\n System.out.println(\"Entities recognition action results:\");\n analyzeActionsResult.getRecognizeEntitiesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(\n entitiesResult -> entitiesResult.getEntities().forEach(\n entity -> System.out.printf(\n \"Recognized entity: %s, entity category: %s, entity subcategory: %s,\"\n + \" confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(),\n entity.getConfidenceScore())));\n }\n });\n System.out.println(\"Key phrases extraction action results:\");\n analyzeActionsResult.getExtractKeyPhrasesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(extractKeyPhraseResult -> {\n System.out.println(\"Extracted phrases:\");\n extractKeyPhraseResult.getKeyPhrases()\n .forEach(keyPhrases -> System.out.printf(\"\\t%s.%n\", keyPhrases));\n });\n }\n });\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the analyze a collection of actions operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeActionsResultPagedIterable\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AnalyzeActionsOperationDetail?alt=com.azure.ai.textanalytics.models.AnalyzeActionsOperationDetail&text=AnalyzeActionsOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable?alt=com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable&text=AnalyzeActionsResultPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeActions(java.lang.Iterable<java.lang.String>,com.azure.ai.textanalytics.models.TextAnalyticsActions,java.lang.String,com.azure.ai.textanalytics.models.AnalyzeActionsOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions, String language, AnalyzeActionsOptions options)"
name: "beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions, String language, AnalyzeActionsOptions options)"
nameWithType: "TextAnalyticsClient.beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions, String language, AnalyzeActionsOptions options)"
summary: "Execute actions, such as, entities recognition, PII entities recognition and key phrases extraction for a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsActions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"actions\"></xref> that contains all actions to be executed.\n An action is one task of execution, such as a single task of 'Key Phrases Extraction' on the given document\n inputs."
name: "actions"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsActions?alt=com.azure.ai.textanalytics.models.TextAnalyticsActions&text=TextAnalyticsActions\" data-throw-if-not-resolved=\"False\" />"
- description: "The 2 letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeActionsOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n analyzing a collection of actions."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AnalyzeActionsOptions?alt=com.azure.ai.textanalytics.models.AnalyzeActionsOptions&text=AnalyzeActionsOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<AnalyzeActionsOperationDetail,AnalyzeActionsResultPagedIterable> beginAnalyzeActions(Iterable<String> documents, TextAnalyticsActions actions, String language, AnalyzeActionsOptions options)"
desc: "Execute actions, such as, entities recognition, PII entities recognition and key phrases extraction for a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> with provided request options. See [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<String> documents = Arrays.asList(\n \"Elon Musk is the CEO of SpaceX and Tesla.\",\n \"My SSN is 859-98-0987\"\n );\n\n SyncPoller<AnalyzeActionsOperationDetail, AnalyzeActionsResultPagedIterable> syncPoller =\n textAnalyticsClient.beginAnalyzeActions(\n documents,\n new TextAnalyticsActions().setDisplayName(\"{tasks_display_name}\")\n .setRecognizeEntitiesActions(new RecognizeEntitiesAction())\n .setExtractKeyPhrasesActions(new ExtractKeyPhrasesAction()),\n \"en\",\n new AnalyzeActionsOptions().setIncludeStatistics(false));\n syncPoller.waitForCompletion();\n AnalyzeActionsResultPagedIterable result = syncPoller.getFinalResult();\n result.forEach(analyzeActionsResult -> {\n System.out.println(\"Entities recognition action results:\");\n analyzeActionsResult.getRecognizeEntitiesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(\n entitiesResult -> entitiesResult.getEntities().forEach(\n entity -> System.out.printf(\n \"Recognized entity: %s, entity category: %s, entity subcategory: %s,\"\n + \" confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(),\n entity.getConfidenceScore())));\n }\n });\n System.out.println(\"Key phrases extraction action results:\");\n analyzeActionsResult.getExtractKeyPhrasesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(extractKeyPhraseResult -> {\n System.out.println(\"Extracted phrases:\");\n extractKeyPhraseResult.getKeyPhrases()\n .forEach(keyPhrases -> System.out.printf(\"\\t%s.%n\", keyPhrases));\n });\n }\n });\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the analyze a collection of actions operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeActionsResultPagedIterable\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AnalyzeActionsOperationDetail?alt=com.azure.ai.textanalytics.models.AnalyzeActionsOperationDetail&text=AnalyzeActionsOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable?alt=com.azure.ai.textanalytics.util.AnalyzeActionsResultPagedIterable&text=AnalyzeActionsResultPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeHealthcareEntities(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeHealthcareEntities(Iterable<TextDocumentInput> documents, AnalyzeHealthcareEntitiesOptions options, Context context)"
name: "beginAnalyzeHealthcareEntities(Iterable<TextDocumentInput> documents, AnalyzeHealthcareEntitiesOptions options, Context context)"
nameWithType: "TextAnalyticsClient.beginAnalyzeHealthcareEntities(Iterable<TextDocumentInput> documents, AnalyzeHealthcareEntitiesOptions options, Context context)"
summary: "Analyze healthcare entities, entity data sources, and entity relations in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> and provided request options to show statistics."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing healthcare entities."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions?alt=com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions&text=AnalyzeHealthcareEntitiesOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<AnalyzeHealthcareEntitiesOperationDetail,AnalyzeHealthcareEntitiesPagedIterable> beginAnalyzeHealthcareEntities(Iterable<TextDocumentInput> documents, AnalyzeHealthcareEntitiesOptions options, Context context)"
desc: "Analyze healthcare entities, entity data sources, and entity relations in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> and provided request options to show statistics. See [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<TextDocumentInput> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(new TextDocumentInput(Integer.toString(i),\n \"The patient is a 54-year-old gentleman with a history of progressive angina over \"\n + \"the past several months.\"));\n }\n\n // Request options: show statistics and model version\n AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions()\n .setIncludeStatistics(true);\n\n SyncPoller<AnalyzeHealthcareEntitiesOperationDetail, AnalyzeHealthcareEntitiesPagedIterable>\n syncPoller = textAnalyticsClient.beginAnalyzeHealthcareEntities(documents, options, Context.NONE);\n\n syncPoller.waitForCompletion();\n AnalyzeHealthcareEntitiesPagedIterable result = syncPoller.getFinalResult();\n\n // Task operation statistics\n AnalyzeHealthcareEntitiesOperationDetail operationResult = syncPoller.poll().getValue();\n System.out.printf(\"Operation created time: %s, expiration time: %s.%n\",\n operationResult.getCreatedAt(), operationResult.getExpiresAt());\n\n result.forEach(analyzeHealthcareEntitiesResultCollection -> {\n // Model version\n System.out.printf(\"Results of Azure Text Analytics \\\"Analyze Healthcare\\\" Model, version: %s%n\",\n analyzeHealthcareEntitiesResultCollection.getModelVersion());\n\n TextDocumentBatchStatistics healthcareTaskStatistics =\n analyzeHealthcareEntitiesResultCollection.getStatistics();\n // Batch statistics\n System.out.printf(\"Documents statistics: document count = %d, erroneous document count = %d,\"\n + \" transaction count = %d, valid document count = %d.%n\",\n healthcareTaskStatistics.getDocumentCount(), healthcareTaskStatistics.getInvalidDocumentCount(),\n healthcareTaskStatistics.getTransactionCount(), healthcareTaskStatistics.getValidDocumentCount());\n\n analyzeHealthcareEntitiesResultCollection.forEach(healthcareEntitiesResult -> {\n System.out.println(\"document id = \" + healthcareEntitiesResult.getId());\n System.out.println(\"Document entities: \");\n AtomicInteger ct = new AtomicInteger();\n healthcareEntitiesResult.getEntities().forEach(healthcareEntity -> {\n System.out.printf(\"\\ti = %d, Text: %s, category: %s, confidence score: %f.%n\",\n ct.getAndIncrement(), healthcareEntity.getText(), healthcareEntity.getCategory(),\n healthcareEntity.getConfidenceScore());\n\n IterableStream<EntityDataSource> healthcareEntityDataSources =\n healthcareEntity.getDataSources();\n if (healthcareEntityDataSources != null) {\n healthcareEntityDataSources.forEach(healthcareEntityLink -> System.out.printf(\n \"\\t\\tEntity ID in data source: %s, data source: %s.%n\",\n healthcareEntityLink.getEntityId(), healthcareEntityLink.getName()));\n }\n });\n // Healthcare entity relation groups\n healthcareEntitiesResult.getEntityRelations().forEach(entityRelation -> {\n System.out.printf(\"\\tRelation type: %s.%n\", entityRelation.getRelationType());\n entityRelation.getRoles().forEach(role -> {\n final HealthcareEntity entity = role.getEntity();\n System.out.printf(\"\\t\\tEntity text: %s, category: %s, role: %s.%n\",\n entity.getText(), entity.getCategory(), role.getName());\n });\n System.out.printf(\"\\tRelation confidence score: %f.%n\", entityRelation.getConfidenceScore());\n });\n });\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the analyze healthcare operation until it has completed, has failed,\n or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeHealthcareEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOperationDetail?alt=com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOperationDetail&text=AnalyzeHealthcareEntitiesOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesPagedIterable?alt=com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesPagedIterable&text=AnalyzeHealthcareEntitiesPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeHealthcareEntities(java.lang.Iterable<java.lang.String>)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeHealthcareEntities(Iterable<String> documents)"
name: "beginAnalyzeHealthcareEntities(Iterable<String> documents)"
nameWithType: "TextAnalyticsClient.beginAnalyzeHealthcareEntities(Iterable<String> documents)"
summary: "Analyze healthcare entities, entity data sources, and entity relations in a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public SyncPoller<AnalyzeHealthcareEntitiesOperationDetail,AnalyzeHealthcareEntitiesPagedIterable> beginAnalyzeHealthcareEntities(Iterable<String> documents)"
desc: "Analyze healthcare entities, entity data sources, and entity relations in a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref>. This method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\"The patient is a 54-year-old gentleman with a history of progressive angina over \"\n + \"the past several months.\");\n }\n\n SyncPoller<AnalyzeHealthcareEntitiesOperationDetail, AnalyzeHealthcareEntitiesPagedIterable>\n syncPoller = textAnalyticsClient.beginAnalyzeHealthcareEntities(documents);\n\n syncPoller.waitForCompletion();\n AnalyzeHealthcareEntitiesPagedIterable result = syncPoller.getFinalResult();\n\n result.forEach(analyzeHealthcareEntitiesResultCollection -> {\n analyzeHealthcareEntitiesResultCollection.forEach(healthcareEntitiesResult -> {\n System.out.println(\"document id = \" + healthcareEntitiesResult.getId());\n System.out.println(\"Document entities: \");\n AtomicInteger ct = new AtomicInteger();\n healthcareEntitiesResult.getEntities().forEach(healthcareEntity -> {\n System.out.printf(\"\\ti = %d, Text: %s, category: %s, confidence score: %f.%n\",\n ct.getAndIncrement(), healthcareEntity.getText(), healthcareEntity.getCategory(),\n healthcareEntity.getConfidenceScore());\n\n IterableStream<EntityDataSource> healthcareEntityDataSources =\n healthcareEntity.getDataSources();\n if (healthcareEntityDataSources != null) {\n healthcareEntityDataSources.forEach(healthcareEntityLink -> System.out.printf(\n \"\\t\\tEntity ID in data source: %s, data source: %s.%n\",\n healthcareEntityLink.getEntityId(), healthcareEntityLink.getName()));\n }\n });\n // Healthcare entity relation groups\n healthcareEntitiesResult.getEntityRelations().forEach(entityRelation -> {\n System.out.printf(\"\\tRelation type: %s.%n\", entityRelation.getRelationType());\n entityRelation.getRoles().forEach(role -> {\n final HealthcareEntity entity = role.getEntity();\n System.out.printf(\"\\t\\tEntity text: %s, category: %s, role: %s.%n\",\n entity.getText(), entity.getCategory(), role.getName());\n });\n System.out.printf(\"\\tRelation confidence score: %f.%n\",\n entityRelation.getConfidenceScore());\n });\n });\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the analyze healthcare operation until it has completed, has failed,\n or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeHealthcareEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOperationDetail?alt=com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOperationDetail&text=AnalyzeHealthcareEntitiesOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesPagedIterable?alt=com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesPagedIterable&text=AnalyzeHealthcareEntitiesPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeHealthcareEntities(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeHealthcareEntities(Iterable<String> documents, String language, AnalyzeHealthcareEntitiesOptions options)"
name: "beginAnalyzeHealthcareEntities(Iterable<String> documents, String language, AnalyzeHealthcareEntitiesOptions options)"
nameWithType: "TextAnalyticsClient.beginAnalyzeHealthcareEntities(Iterable<String> documents, String language, AnalyzeHealthcareEntitiesOptions options)"
summary: "Analyze healthcare entities, entity data sources, and entity relations in a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2-letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing healthcare entities."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions?alt=com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions&text=AnalyzeHealthcareEntitiesOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<AnalyzeHealthcareEntitiesOperationDetail,AnalyzeHealthcareEntitiesPagedIterable> beginAnalyzeHealthcareEntities(Iterable<String> documents, String language, AnalyzeHealthcareEntitiesOptions options)"
desc: "Analyze healthcare entities, entity data sources, and entity relations in a list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> with provided request options. See [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\"The patient is a 54-year-old gentleman with a history of progressive angina over \"\n + \"the past several months.\");\n }\n\n // Request options: show statistics and model version\n AnalyzeHealthcareEntitiesOptions options = new AnalyzeHealthcareEntitiesOptions()\n .setIncludeStatistics(true);\n\n SyncPoller<AnalyzeHealthcareEntitiesOperationDetail, AnalyzeHealthcareEntitiesPagedIterable>\n syncPoller = textAnalyticsClient.beginAnalyzeHealthcareEntities(documents, \"en\", options);\n\n syncPoller.waitForCompletion();\n AnalyzeHealthcareEntitiesPagedIterable result = syncPoller.getFinalResult();\n\n result.forEach(analyzeHealthcareEntitiesResultCollection -> {\n // Model version\n System.out.printf(\"Results of Azure Text Analytics \\\"Analyze Healthcare\\\" Model, version: %s%n\",\n analyzeHealthcareEntitiesResultCollection.getModelVersion());\n\n TextDocumentBatchStatistics healthcareTaskStatistics =\n analyzeHealthcareEntitiesResultCollection.getStatistics();\n // Batch statistics\n System.out.printf(\"Documents statistics: document count = %d, erroneous document count = %d,\"\n + \" transaction count = %d, valid document count = %d.%n\",\n healthcareTaskStatistics.getDocumentCount(), healthcareTaskStatistics.getInvalidDocumentCount(),\n healthcareTaskStatistics.getTransactionCount(), healthcareTaskStatistics.getValidDocumentCount());\n\n analyzeHealthcareEntitiesResultCollection.forEach(healthcareEntitiesResult -> {\n System.out.println(\"document id = \" + healthcareEntitiesResult.getId());\n System.out.println(\"Document entities: \");\n AtomicInteger ct = new AtomicInteger();\n healthcareEntitiesResult.getEntities().forEach(healthcareEntity -> {\n System.out.printf(\"\\ti = %d, Text: %s, category: %s, confidence score: %f.%n\",\n ct.getAndIncrement(), healthcareEntity.getText(), healthcareEntity.getCategory(),\n healthcareEntity.getConfidenceScore());\n\n IterableStream<EntityDataSource> healthcareEntityDataSources =\n healthcareEntity.getDataSources();\n if (healthcareEntityDataSources != null) {\n healthcareEntityDataSources.forEach(healthcareEntityLink -> System.out.printf(\n \"\\t\\tEntity ID in data source: %s, data source: %s.%n\",\n healthcareEntityLink.getEntityId(), healthcareEntityLink.getName()));\n }\n });\n // Healthcare entity relation groups\n healthcareEntitiesResult.getEntityRelations().forEach(entityRelation -> {\n System.out.printf(\"\\tRelation type: %s.%n\", entityRelation.getRelationType());\n entityRelation.getRoles().forEach(role -> {\n final HealthcareEntity entity = role.getEntity();\n System.out.printf(\"\\t\\tEntity text: %s, category: %s, role: %s.%n\",\n entity.getText(), entity.getCategory(), role.getName());\n });\n System.out.printf(\"\\tRelation confidence score: %f.%n\", entityRelation.getConfidenceScore());\n });\n });\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the analyze healthcare operation until it has completed, has failed,\n or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeHealthcareEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOperationDetail?alt=com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOperationDetail&text=AnalyzeHealthcareEntitiesOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesPagedIterable?alt=com.azure.ai.textanalytics.util.AnalyzeHealthcareEntitiesPagedIterable&text=AnalyzeHealthcareEntitiesPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginExtractSummary(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.ExtractiveSummaryOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginExtractSummary(Iterable<TextDocumentInput> documents, ExtractiveSummaryOptions options, Context context)"
name: "beginExtractSummary(Iterable<TextDocumentInput> documents, ExtractiveSummaryOptions options, Context context)"
nameWithType: "TextAnalyticsClient.beginExtractSummary(Iterable<TextDocumentInput> documents, ExtractiveSummaryOptions options, Context context)"
summary: "Returns a list of extract summaries for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.ExtractiveSummaryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing extractive summarization."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.ExtractiveSummaryOptions?alt=com.azure.ai.textanalytics.models.ExtractiveSummaryOptions&text=ExtractiveSummaryOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<ExtractiveSummaryOperationDetail,ExtractiveSummaryPagedIterable> beginExtractSummary(Iterable<TextDocumentInput> documents, ExtractiveSummaryOptions options, Context context)"
desc: "Returns a list of extract summaries for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2023_04_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2023_04_01\"></xref>.\n\n**Code Sample**\n\n```java\nList<TextDocumentInput> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(new TextDocumentInput(Integer.toString(i),\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\"));\n }\n SyncPoller<ExtractiveSummaryOperationDetail, ExtractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginExtractSummary(documents,\n new ExtractiveSummaryOptions().setMaxSentenceCount(4).setOrderBy(ExtractiveSummarySentencesOrder.RANK),\n Context.NONE);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (ExtractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tExtracted summary sentences:\");\n for (ExtractiveSummarySentence extractiveSummarySentence : documentResult.getSentences()) {\n System.out.printf(\n \"\\t\\t Sentence text: %s, length: %d, offset: %d, rank score: %f.%n\",\n extractiveSummarySentence.getText(), extractiveSummarySentence.getLength(),\n extractiveSummarySentence.getOffset(), extractiveSummarySentence.getRankScore());\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the extractive summarization operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ExtractiveSummaryResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExtractiveSummaryResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ExtractiveSummaryOperationDetail?alt=com.azure.ai.textanalytics.models.ExtractiveSummaryOperationDetail&text=ExtractiveSummaryOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ExtractiveSummaryPagedIterable?alt=com.azure.ai.textanalytics.util.ExtractiveSummaryPagedIterable&text=ExtractiveSummaryPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginExtractSummary(java.lang.Iterable<java.lang.String>)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginExtractSummary(Iterable<String> documents)"
name: "beginExtractSummary(Iterable<String> documents)"
nameWithType: "TextAnalyticsClient.beginExtractSummary(Iterable<String> documents)"
summary: "Returns a list of extract summaries for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public SyncPoller<ExtractiveSummaryOperationDetail,ExtractiveSummaryPagedIterable> beginExtractSummary(Iterable<String> documents)"
desc: "Returns a list of extract summaries for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2023_04_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2023_04_01\"></xref>.\n\nThis method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\");\n }\n SyncPoller<ExtractiveSummaryOperationDetail, ExtractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginExtractSummary(documents);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (ExtractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tExtracted summary sentences:\");\n for (ExtractiveSummarySentence extractiveSummarySentence : documentResult.getSentences()) {\n System.out.printf(\n \"\\t\\t Sentence text: %s, length: %d, offset: %d, rank score: %f.%n\",\n extractiveSummarySentence.getText(), extractiveSummarySentence.getLength(),\n extractiveSummarySentence.getOffset(), extractiveSummarySentence.getRankScore());\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the extractive summarization operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ExtractiveSummaryResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExtractiveSummaryResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ExtractiveSummaryOperationDetail?alt=com.azure.ai.textanalytics.models.ExtractiveSummaryOperationDetail&text=ExtractiveSummaryOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ExtractiveSummaryPagedIterable?alt=com.azure.ai.textanalytics.util.ExtractiveSummaryPagedIterable&text=ExtractiveSummaryPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginExtractSummary(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.ExtractiveSummaryOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginExtractSummary(Iterable<String> documents, String language, ExtractiveSummaryOptions options)"
name: "beginExtractSummary(Iterable<String> documents, String language, ExtractiveSummaryOptions options)"
nameWithType: "TextAnalyticsClient.beginExtractSummary(Iterable<String> documents, String language, ExtractiveSummaryOptions options)"
summary: "Returns a list of extract summaries for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2-letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.ExtractiveSummaryOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing extractive summarization."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.ExtractiveSummaryOptions?alt=com.azure.ai.textanalytics.models.ExtractiveSummaryOptions&text=ExtractiveSummaryOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<ExtractiveSummaryOperationDetail,ExtractiveSummaryPagedIterable> beginExtractSummary(Iterable<String> documents, String language, ExtractiveSummaryOptions options)"
desc: "Returns a list of extract summaries for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2023_04_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2023_04_01\"></xref>.\n\nSee [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\");\n }\n SyncPoller<ExtractiveSummaryOperationDetail, ExtractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginExtractSummary(documents,\n \"en\",\n new ExtractiveSummaryOptions().setMaxSentenceCount(4).setOrderBy(ExtractiveSummarySentencesOrder.RANK));\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (ExtractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tExtracted summary sentences:\");\n for (ExtractiveSummarySentence extractiveSummarySentence : documentResult.getSentences()) {\n System.out.printf(\n \"\\t\\t Sentence text: %s, length: %d, offset: %d, rank score: %f.%n\",\n extractiveSummarySentence.getText(), extractiveSummarySentence.getLength(),\n extractiveSummarySentence.getOffset(), extractiveSummarySentence.getRankScore());\n }\n }\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the extractive summarization operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ExtractiveSummaryResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExtractiveSummaryResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ExtractiveSummaryOperationDetail?alt=com.azure.ai.textanalytics.models.ExtractiveSummaryOperationDetail&text=ExtractiveSummaryOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ExtractiveSummaryPagedIterable?alt=com.azure.ai.textanalytics.util.ExtractiveSummaryPagedIterable&text=ExtractiveSummaryPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginMultiLabelClassify(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.MultiLabelClassifyOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginMultiLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, MultiLabelClassifyOptions options, Context context)"
name: "beginMultiLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, MultiLabelClassifyOptions options, Context context)"
nameWithType: "TextAnalyticsClient.beginMultiLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, MultiLabelClassifyOptions options, Context context)"
summary: "Returns a list of multi-label classification for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.SingleLabelClassifyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing multi-label classification."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.MultiLabelClassifyOptions?alt=com.azure.ai.textanalytics.models.MultiLabelClassifyOptions&text=MultiLabelClassifyOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<ClassifyDocumentOperationDetail,ClassifyDocumentPagedIterable> beginMultiLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, MultiLabelClassifyOptions options, Context context)"
desc: "Returns a list of multi-label classification for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\n**Code Sample**\n\n```java\nList<TextDocumentInput> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(new TextDocumentInput(Integer.toString(i),\n \"I need a reservation for an indoor restaurant in China. Please don't stop the music.\"\n + \" Play music and add it to my playlist\"));\n }\n MultiLabelClassifyOptions options = new MultiLabelClassifyOptions().setIncludeStatistics(true);\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginMultiLabelClassify(documents, \"{project_name}\", \"{deployment_name}\",\n options, Context.NONE);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the multi-label classification operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ClassifyDocumentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClassifyDocumentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail?alt=com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail&text=ClassifyDocumentOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable?alt=com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable&text=ClassifyDocumentPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginMultiLabelClassify(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
name: "beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
nameWithType: "TextAnalyticsClient.beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
summary: "Returns a list of multi-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public SyncPoller<ClassifyDocumentOperationDetail,ClassifyDocumentPagedIterable> beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
desc: "Returns a list of multi-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\nThis method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"I need a reservation for an indoor restaurant in China. Please don't stop the music.\"\n + \" Play music and add it to my playlist\");\n }\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginMultiLabelClassify(documents, \"{project_name}\", \"{deployment_name}\");\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the multi-label classification operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ClassifyDocumentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClassifyDocumentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail?alt=com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail&text=ClassifyDocumentOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable?alt=com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable&text=ClassifyDocumentPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginMultiLabelClassify(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.MultiLabelClassifyOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, MultiLabelClassifyOptions options)"
name: "beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, MultiLabelClassifyOptions options)"
nameWithType: "TextAnalyticsClient.beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, MultiLabelClassifyOptions options)"
summary: "Returns a list of multi-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2-letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.SingleLabelClassifyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing multi-label classification."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.MultiLabelClassifyOptions?alt=com.azure.ai.textanalytics.models.MultiLabelClassifyOptions&text=MultiLabelClassifyOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<ClassifyDocumentOperationDetail,ClassifyDocumentPagedIterable> beginMultiLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, MultiLabelClassifyOptions options)"
desc: "Returns a list of multi-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\nSee [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"I need a reservation for an indoor restaurant in China. Please don't stop the music.\"\n + \" Play music and add it to my playlist\");\n }\n MultiLabelClassifyOptions options = new MultiLabelClassifyOptions().setIncludeStatistics(true);\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginMultiLabelClassify(documents, \"{project_name}\", \"{deployment_name}\", \"en\", options);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the multi-label classification operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ClassifyDocumentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClassifyDocumentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail?alt=com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail&text=ClassifyDocumentOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable?alt=com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable&text=ClassifyDocumentPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginRecognizeCustomEntities(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginRecognizeCustomEntities(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, RecognizeCustomEntitiesOptions options, Context context)"
name: "beginRecognizeCustomEntities(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, RecognizeCustomEntitiesOptions options, Context context)"
nameWithType: "TextAnalyticsClient.beginRecognizeCustomEntities(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, RecognizeCustomEntitiesOptions options, Context context)"
summary: "Returns a list of custom entities for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed.\n English as default."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when recognizing custom entities."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions?alt=com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions&text=RecognizeCustomEntitiesOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<RecognizeCustomEntitiesOperationDetail,RecognizeCustomEntitiesPagedIterable> beginRecognizeCustomEntities(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, RecognizeCustomEntitiesOptions options, Context context)"
desc: "Returns a list of custom entities for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>\n\nSee [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<TextDocumentInput> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(new TextDocumentInput(Integer.toString(i),\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"));\n RecognizeCustomEntitiesOptions options = new RecognizeCustomEntitiesOptions().setIncludeStatistics(true);\n SyncPoller<RecognizeCustomEntitiesOperationDetail, RecognizeCustomEntitiesPagedIterable> syncPoller =\n textAnalyticsClient.beginRecognizeCustomEntities(documents, \"{project_name}\",\n \"{deployment_name}\", options, Context.NONE);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (RecognizeEntitiesResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (CategorizedEntity entity : documentResult.getEntities()) {\n System.out.printf(\n \"\\tText: %s, category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore());\n }\n }\n });\n }\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the recognize custom entities operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.RecognizeCustomEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizeCustomEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOperationDetail?alt=com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOperationDetail&text=RecognizeCustomEntitiesOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.RecognizeCustomEntitiesPagedIterable?alt=com.azure.ai.textanalytics.util.RecognizeCustomEntitiesPagedIterable&text=RecognizeCustomEntitiesPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginRecognizeCustomEntities(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName)"
name: "beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName)"
nameWithType: "TextAnalyticsClient.beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName)"
summary: "Returns a list of custom entities for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public SyncPoller<RecognizeCustomEntitiesOperationDetail,RecognizeCustomEntitiesPagedIterable> beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName)"
desc: "Returns a list of custom entities for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\nThis method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"); }\n SyncPoller<RecognizeCustomEntitiesOperationDetail, RecognizeCustomEntitiesPagedIterable> syncPoller =\n textAnalyticsClient.beginRecognizeCustomEntities(documents, \"{project_name}\", \"{deployment_name}\");\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (RecognizeEntitiesResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (CategorizedEntity entity : documentResult.getEntities()) {\n System.out.printf(\n \"\\tText: %s, category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore());\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the recognize custom entities operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.RecognizeCustomEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizeCustomEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOperationDetail?alt=com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOperationDetail&text=RecognizeCustomEntitiesOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.RecognizeCustomEntitiesPagedIterable?alt=com.azure.ai.textanalytics.util.RecognizeCustomEntitiesPagedIterable&text=RecognizeCustomEntitiesPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginRecognizeCustomEntities(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName, String language, RecognizeCustomEntitiesOptions options)"
name: "beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName, String language, RecognizeCustomEntitiesOptions options)"
nameWithType: "TextAnalyticsClient.beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName, String language, RecognizeCustomEntitiesOptions options)"
summary: "Returns a list of custom entities for the provided list of document with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2-letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when recognizing custom entities."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions?alt=com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOptions&text=RecognizeCustomEntitiesOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<RecognizeCustomEntitiesOperationDetail,RecognizeCustomEntitiesPagedIterable> beginRecognizeCustomEntities(Iterable<String> documents, String projectName, String deploymentName, String language, RecognizeCustomEntitiesOptions options)"
desc: "Returns a list of custom entities for the provided list of document with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\nSee [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"); }\n RecognizeCustomEntitiesOptions options = new RecognizeCustomEntitiesOptions().setIncludeStatistics(true);\n SyncPoller<RecognizeCustomEntitiesOperationDetail, RecognizeCustomEntitiesPagedIterable> syncPoller =\n textAnalyticsClient.beginRecognizeCustomEntities(documents, \"{project_name}\",\n \"{deployment_name}\", \"en\", options);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (RecognizeEntitiesResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (CategorizedEntity entity : documentResult.getEntities()) {\n System.out.printf(\n \"\\tText: %s, category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore());\n }\n }\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the recognize custom entities operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.RecognizeCustomEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizeCustomEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOperationDetail?alt=com.azure.ai.textanalytics.models.RecognizeCustomEntitiesOperationDetail&text=RecognizeCustomEntitiesOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.RecognizeCustomEntitiesPagedIterable?alt=com.azure.ai.textanalytics.util.RecognizeCustomEntitiesPagedIterable&text=RecognizeCustomEntitiesPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginSingleLabelClassify(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.SingleLabelClassifyOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginSingleLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, SingleLabelClassifyOptions options, Context context)"
name: "beginSingleLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, SingleLabelClassifyOptions options, Context context)"
nameWithType: "TextAnalyticsClient.beginSingleLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, SingleLabelClassifyOptions options, Context context)"
summary: "Returns a list of single-label classification for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.SingleLabelClassifyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing single-label classification."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.SingleLabelClassifyOptions?alt=com.azure.ai.textanalytics.models.SingleLabelClassifyOptions&text=SingleLabelClassifyOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<ClassifyDocumentOperationDetail,ClassifyDocumentPagedIterable> beginSingleLabelClassify(Iterable<TextDocumentInput> documents, String projectName, String deploymentName, SingleLabelClassifyOptions options, Context context)"
desc: "Returns a list of single-label classification for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\n**Code Sample**\n\n```java\nList<TextDocumentInput> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(new TextDocumentInput(Integer.toString(i),\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"));\n }\n SingleLabelClassifyOptions options = new SingleLabelClassifyOptions().setIncludeStatistics(true);\n // See the service documentation for regional support and how to train a model to classify your documents,\n // see https://aka.ms/azsdk/textanalytics/customfunctionalities\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginSingleLabelClassify(documents, \"{project_name}\", \"{deployment_name}\",\n options, Context.NONE);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the single-label classification operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ClassifyDocumentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClassifyDocumentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail?alt=com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail&text=ClassifyDocumentOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable?alt=com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable&text=ClassifyDocumentPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginSingleLabelClassify(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
name: "beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
nameWithType: "TextAnalyticsClient.beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
summary: "Returns a list of single-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public SyncPoller<ClassifyDocumentOperationDetail,ClassifyDocumentPagedIterable> beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName)"
desc: "Returns a list of single-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref>.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\nThis method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"\n );\n }\n // See the service documentation for regional support and how to train a model to classify your documents,\n // see https://aka.ms/azsdk/textanalytics/customfunctionalities\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginSingleLabelClassify(documents, \"{project_name}\", \"{deployment_name}\");\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the single-label classification operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ClassifyDocumentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClassifyDocumentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail?alt=com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail&text=ClassifyDocumentOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable?alt=com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable&text=ClassifyDocumentPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.beginSingleLabelClassify(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.SingleLabelClassifyOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, SingleLabelClassifyOptions options)"
name: "beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, SingleLabelClassifyOptions options)"
nameWithType: "TextAnalyticsClient.beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, SingleLabelClassifyOptions options)"
summary: "Returns a list of single-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The name of the project which owns the model being consumed."
name: "projectName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The name of the deployment being consumed."
name: "deploymentName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2-letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.SingleLabelClassifyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed\n when analyzing single-label classification."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.SingleLabelClassifyOptions?alt=com.azure.ai.textanalytics.models.SingleLabelClassifyOptions&text=SingleLabelClassifyOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<ClassifyDocumentOperationDetail,ClassifyDocumentPagedIterable> beginSingleLabelClassify(Iterable<String> documents, String projectName, String deploymentName, String language, SingleLabelClassifyOptions options)"
desc: "Returns a list of single-label classification for the provided list of <xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\nSee [this][] supported languages in Language service API.\n\n**Code Sample**\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"\n );\n }\n SingleLabelClassifyOptions options = new SingleLabelClassifyOptions().setIncludeStatistics(true);\n // See the service documentation for regional support and how to train a model to classify your documents,\n // see https://aka.ms/azsdk/textanalytics/customfunctionalities\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginSingleLabelClassify(documents, \"{project_name}\", \"{deployment_name}\",\n \"en\", options);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the single-label classification operation until it has completed,\n has failed, or has been cancelled. The completed operation returns a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of\n <xref uid=\"com.azure.ai.textanalytics.util.ClassifyDocumentResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClassifyDocumentResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail?alt=com.azure.ai.textanalytics.models.ClassifyDocumentOperationDetail&text=ClassifyDocumentOperationDetail\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable?alt=com.azure.ai.textanalytics.util.ClassifyDocumentPagedIterable&text=ClassifyDocumentPagedIterable\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguage(java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguage(String document)"
name: "detectLanguage(String document)"
nameWithType: "TextAnalyticsClient.detectLanguage(String document)"
summary: "Returns the detected language and a confidence score between zero and one."
parameters:
- description: "The document to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public DetectedLanguage detectLanguage(String document)"
desc: "Returns the detected language and a confidence score between zero and one. Scores close to one indicate 100% certainty that the identified language is true. This method will use the default country hint that sets up in <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultCountryHint(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultCountryHint(String)\"></xref>. If none is specified, service will use 'US' as the country hint.\n\n**Code Sample**\n\nDetects the language of single document.\n\n```java\nDetectedLanguage detectedLanguage = textAnalyticsClient.detectLanguage(\"Bonjour tout le monde\");\n System.out.printf(\"Detected language name: %s, ISO 6391 name: %s, confidence score: %f.%n\",\n detectedLanguage.getName(), detectedLanguage.getIso6391Name(), detectedLanguage.getConfidenceScore());\n```"
returns:
description: "The <xref uid=\"com.azure.ai.textanalytics.models.DetectedLanguage\" data-throw-if-not-resolved=\"false\" data-raw-source=\"detected language\"></xref> of the document."
type: "<xref href=\"com.azure.ai.textanalytics.models.DetectedLanguage?alt=com.azure.ai.textanalytics.models.DetectedLanguage&text=DetectedLanguage\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguage(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguage(String document, String countryHint)"
name: "detectLanguage(String document, String countryHint)"
nameWithType: "TextAnalyticsClient.detectLanguage(String document, String countryHint)"
summary: "Returns the detected language and a confidence score between zero and one."
parameters:
- description: "The document to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Accepts two letter country codes specified by ISO 3166-1 alpha-2. Defaults to \"US\" if not\n specified. To remove this behavior you can reset this parameter by setting this value to empty string\n <code>countryHint</code> = \"\" or \"none\"."
name: "countryHint"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public DetectedLanguage detectLanguage(String document, String countryHint)"
desc: "Returns the detected language and a confidence score between zero and one. Scores close to one indicate 100% certainty that the identified language is true.\n\n**Code Sample**\n\nDetects the language of documents with a provided country hint.\n\n```java\nDetectedLanguage detectedLanguage = textAnalyticsClient.detectLanguage(\n \"This text is in English\", \"US\");\n System.out.printf(\"Detected language name: %s, ISO 6391 name: %s, confidence score: %f.%n\",\n detectedLanguage.getName(), detectedLanguage.getIso6391Name(), detectedLanguage.getConfidenceScore());\n```"
returns:
description: "The <xref uid=\"com.azure.ai.textanalytics.models.DetectedLanguage\" data-throw-if-not-resolved=\"false\" data-raw-source=\"detected language\"></xref> of the document."
type: "<xref href=\"com.azure.ai.textanalytics.models.DetectedLanguage?alt=com.azure.ai.textanalytics.models.DetectedLanguage&text=DetectedLanguage\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguageBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguageBatch(Iterable<String> documents, String countryHint, TextAnalyticsRequestOptions options)"
name: "detectLanguageBatch(Iterable<String> documents, String countryHint, TextAnalyticsRequestOptions options)"
nameWithType: "TextAnalyticsClient.detectLanguageBatch(Iterable<String> documents, String countryHint, TextAnalyticsRequestOptions options)"
summary: "Detects Language for a batch of document with the provided country hint and request options."
parameters:
- description: "The list of documents to detect languages for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "Accepts two letter country codes specified by ISO 3166-1 alpha-2. Defaults to \"US\" if not\n specified. To remove this behavior you can reset this parameter by setting this value to empty string\n <code>countryHint</code> = \"\" or \"none\"."
name: "countryHint"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DetectLanguageResultCollection detectLanguageBatch(Iterable<String> documents, String countryHint, TextAnalyticsRequestOptions options)"
desc: "Detects Language for a batch of document with the provided country hint and request options.\n\n**Code Sample**\n\nDetects the language in a list of documents with a provided country hint and request options.\n\n```java\nList<String> documents = Arrays.asList(\n \"This is written in English\",\n \"Este es un documento escrito en Espa<70>ol.\"\n );\n\n DetectLanguageResultCollection resultCollection =\n textAnalyticsClient.detectLanguageBatch(documents, \"US\", null);\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n // Batch result of languages\n resultCollection.forEach(detectLanguageResult -> {\n System.out.printf(\"Document ID: %s%n\", detectLanguageResult.getId());\n DetectedLanguage detectedLanguage = detectLanguageResult.getPrimaryLanguage();\n System.out.printf(\"Primary language name: %s, ISO 6391 name: %s, confidence score: %f.%n\",\n detectedLanguage.getName(), detectedLanguage.getIso6391Name(),\n detectedLanguage.getConfidenceScore());\n });\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.util.DetectLanguageResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DetectLanguageResultCollection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.util.DetectLanguageResultCollection?alt=com.azure.ai.textanalytics.util.DetectLanguageResultCollection&text=DetectLanguageResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguageBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.DetectLanguageInput>,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguageBatchWithResponse(Iterable<DetectLanguageInput> documents, TextAnalyticsRequestOptions options, Context context)"
name: "detectLanguageBatchWithResponse(Iterable<DetectLanguageInput> documents, TextAnalyticsRequestOptions options, Context context)"
nameWithType: "TextAnalyticsClient.detectLanguageBatchWithResponse(Iterable<DetectLanguageInput> documents, TextAnalyticsRequestOptions options, Context context)"
summary: "Detects Language for a batch of <xref uid=\"com.azure.ai.textanalytics.models.DetectLanguageInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "The list of <xref uid=\"com.azure.ai.textanalytics.models.DetectLanguageInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.DetectLanguageInput?alt=com.azure.ai.textanalytics.models.DetectLanguageInput&text=DetectLanguageInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<DetectLanguageResultCollection> detectLanguageBatchWithResponse(Iterable<DetectLanguageInput> documents, TextAnalyticsRequestOptions options, Context context)"
desc: "Detects Language for a batch of <xref uid=\"com.azure.ai.textanalytics.models.DetectLanguageInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\n**Code Sample**\n\nDetects the languages with http response in a list of <xref uid=\"com.azure.ai.textanalytics.models.DetectLanguageInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\n```java\nList<DetectLanguageInput> detectLanguageInputs = Arrays.asList(\n new DetectLanguageInput(\"1\", \"This is written in English.\", \"US\"),\n new DetectLanguageInput(\"2\", \"Este es un documento escrito en Espa<70>ol.\", \"es\")\n );\n\n Response<DetectLanguageResultCollection> response =\n textAnalyticsClient.detectLanguageBatchWithResponse(detectLanguageInputs,\n new TextAnalyticsRequestOptions().setIncludeStatistics(true), Context.NONE);\n\n // Response's status code\n System.out.printf(\"Status code of request response: %d%n\", response.getStatusCode());\n DetectLanguageResultCollection detectedLanguageResultCollection = response.getValue();\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = detectedLanguageResultCollection.getStatistics();\n System.out.printf(\n \"Documents statistics: document count = %d, erroneous document count = %d, transaction count = %d,\"\n + \" valid document count = %d.%n\",\n batchStatistics.getDocumentCount(), batchStatistics.getInvalidDocumentCount(),\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n // Batch result of languages\n detectedLanguageResultCollection.forEach(detectLanguageResult -> {\n System.out.printf(\"Document ID: %s%n\", detectLanguageResult.getId());\n DetectedLanguage detectedLanguage = detectLanguageResult.getPrimaryLanguage();\n System.out.printf(\"Primary language name: %s, ISO 6391 name: %s, confidence score: %f.%n\",\n detectedLanguage.getName(), detectedLanguage.getIso6391Name(),\n detectedLanguage.getConfidenceScore());\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> that contains a <xref uid=\"com.azure.ai.textanalytics.util.DetectLanguageResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DetectLanguageResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.util.DetectLanguageResultCollection?alt=com.azure.ai.textanalytics.util.DetectLanguageResultCollection&text=DetectLanguageResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrases(java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrases(String document)"
name: "extractKeyPhrases(String document)"
nameWithType: "TextAnalyticsClient.extractKeyPhrases(String document)"
summary: "Returns a list of strings denoting the key phrases in the document."
parameters:
- description: "The document to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public KeyPhrasesCollection extractKeyPhrases(String document)"
desc: "Returns a list of strings denoting the key phrases in the document. This method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\nExtracts key phrases of documents\n\n```java\nKeyPhrasesCollection extractedKeyPhrases =\n textAnalyticsClient.extractKeyPhrases(\"My cat might need to see a veterinarian.\");\n for (String keyPhrase : extractedKeyPhrases) {\n System.out.printf(\"%s.%n\", keyPhrase);\n }\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.KeyPhrasesCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"KeyPhrasesCollection\"></xref> contains a list of extracted key phrases."
type: "<xref href=\"com.azure.ai.textanalytics.models.KeyPhrasesCollection?alt=com.azure.ai.textanalytics.models.KeyPhrasesCollection&text=KeyPhrasesCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrases(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrases(String document, String language)"
name: "extractKeyPhrases(String document, String language)"
nameWithType: "TextAnalyticsClient.extractKeyPhrases(String document, String language)"
summary: "Returns a list of strings denoting the key phrases in the document."
parameters:
- description: "The document to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2 letter ISO 639-1 representation of language for the document. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public KeyPhrasesCollection extractKeyPhrases(String document, String language)"
desc: "Returns a list of strings denoting the key phrases in the document. See [this][] for the list of enabled languages.\n\n**Code Sample**\n\nExtracts key phrases in a document with a provided language representation.\n\n```java\ntextAnalyticsClient.extractKeyPhrases(\"My cat might need to see a veterinarian.\", \"en\")\n .forEach(kegPhrase -> System.out.printf(\"%s.%n\", kegPhrase));\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.KeyPhrasesCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"KeyPhrasesCollection\"></xref> contains a list of extracted key phrases."
type: "<xref href=\"com.azure.ai.textanalytics.models.KeyPhrasesCollection?alt=com.azure.ai.textanalytics.models.KeyPhrasesCollection&text=KeyPhrasesCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrasesBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrasesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
name: "extractKeyPhrasesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
nameWithType: "TextAnalyticsClient.extractKeyPhrasesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
summary: "Returns a list of strings denoting the key phrases in the documents with provided language code and request options."
parameters:
- description: "A list of documents to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2 letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ExtractKeyPhrasesResultCollection extractKeyPhrasesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
desc: "Returns a list of strings denoting the key phrases in the documents with provided language code and request options. See [this][] for the list of enabled languages.\n\n**Code Sample**\n\nExtracts key phrases in a list of documents with a provided language code and request options.\n\n```java\nList<String> documents = Arrays.asList(\n \"My cat might need to see a veterinarian.\",\n \"The pitot tube is used to measure airspeed.\"\n );\n\n // Extracting batch key phrases\n ExtractKeyPhrasesResultCollection resultCollection =\n textAnalyticsClient.extractKeyPhrasesBatch(documents, \"en\", null);\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\n \"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n // Extracted key phrase for each of documents from a batch of documents\n resultCollection.forEach(extractKeyPhraseResult -> {\n System.out.printf(\"Document ID: %s%n\", extractKeyPhraseResult.getId());\n // Valid document\n System.out.println(\"Extracted phrases:\");\n extractKeyPhraseResult.getKeyPhrases().forEach(keyPhrase -> System.out.printf(\"%s.%n\", keyPhrase));\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.util.ExtractKeyPhrasesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExtractKeyPhrasesResultCollection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.util.ExtractKeyPhrasesResultCollection?alt=com.azure.ai.textanalytics.util.ExtractKeyPhrasesResultCollection&text=ExtractKeyPhrasesResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrasesBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrasesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
name: "extractKeyPhrasesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
nameWithType: "TextAnalyticsClient.extractKeyPhrasesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
summary: "Returns a list of strings denoting the key phrases in the a batch of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to be analyzed.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<ExtractKeyPhrasesResultCollection> extractKeyPhrasesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
desc: "Returns a list of strings denoting the key phrases in the a batch of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with request options. See [this][] for the list of enabled languages.\n\n**Code Sample**\n\nExtracts key phrases with http response in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextDocumentInput\"></xref> with request options.\n\n```java\nList<TextDocumentInput> textDocumentInputs = Arrays.asList(\n new TextDocumentInput(\"1\", \"My cat might need to see a veterinarian.\").setLanguage(\"en\"),\n new TextDocumentInput(\"2\", \"The pitot tube is used to measure airspeed.\").setLanguage(\"en\")\n );\n\n // Extracting batch key phrases\n Response<ExtractKeyPhrasesResultCollection> response =\n textAnalyticsClient.extractKeyPhrasesBatchWithResponse(textDocumentInputs,\n new TextAnalyticsRequestOptions().setIncludeStatistics(true), Context.NONE);\n\n\n // Response's status code\n System.out.printf(\"Status code of request response: %d%n\", response.getStatusCode());\n ExtractKeyPhrasesResultCollection resultCollection = response.getValue();\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\n \"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n // Extracted key phrase for each of documents from a batch of documents\n resultCollection.forEach(extractKeyPhraseResult -> {\n System.out.printf(\"Document ID: %s%n\", extractKeyPhraseResult.getId());\n // Valid document\n System.out.println(\"Extracted phrases:\");\n extractKeyPhraseResult.getKeyPhrases().forEach(keyPhrase ->\n System.out.printf(\"%s.%n\", keyPhrase));\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> that contains a <xref uid=\"com.azure.ai.textanalytics.util.ExtractKeyPhrasesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ExtractKeyPhrasesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.util.ExtractKeyPhrasesResultCollection?alt=com.azure.ai.textanalytics.util.ExtractKeyPhrasesResultCollection&text=ExtractKeyPhrasesResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.getDefaultCountryHint()"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.getDefaultCountryHint()"
name: "getDefaultCountryHint()"
nameWithType: "TextAnalyticsClient.getDefaultCountryHint()"
summary: "Gets default country hint code."
syntax: "public String getDefaultCountryHint()"
desc: "Gets default country hint code."
returns:
description: "The default country hint code"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.getDefaultLanguage()"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.getDefaultLanguage()"
name: "getDefaultLanguage()"
nameWithType: "TextAnalyticsClient.getDefaultLanguage()"
summary: "Gets default language when the builder is setup."
syntax: "public String getDefaultLanguage()"
desc: "Gets default language when the builder is setup."
returns:
description: "The default language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities(java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities(String document)"
name: "recognizeEntities(String document)"
nameWithType: "TextAnalyticsClient.recognizeEntities(String document)"
summary: "Returns a list of general categorized entities in the provided document."
parameters:
- description: "The document to recognize entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public CategorizedEntityCollection recognizeEntities(String document)"
desc: "Returns a list of general categorized entities in the provided document. For a list of supported entity types, check: [this][] This method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\nRecognize the entities of documents\n\n```java\nCategorizedEntityCollection recognizeEntitiesResult =\n textAnalyticsClient.recognizeEntities(\"Satya Nadella is the CEO of Microsoft\");\n for (CategorizedEntity entity : recognizeEntitiesResult) {\n System.out.printf(\"Recognized entity: %s, entity category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore());\n }\n```\n\n\n[this]: https://aka.ms/taner"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.CategorizedEntityCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CategorizedEntityCollection\"></xref> contains a list of\n <xref uid=\"com.azure.ai.textanalytics.models.CategorizedEntity\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognized categorized entities\"></xref> and warnings."
type: "<xref href=\"com.azure.ai.textanalytics.models.CategorizedEntityCollection?alt=com.azure.ai.textanalytics.models.CategorizedEntityCollection&text=CategorizedEntityCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities(String document, String language)"
name: "recognizeEntities(String document, String language)"
nameWithType: "TextAnalyticsClient.recognizeEntities(String document, String language)"
summary: "Returns a list of general categorized entities in the provided document with provided language code."
parameters:
- description: "The document to recognize entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2 letter ISO 639-1 representation of language. If not set, uses \"en\" for English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public CategorizedEntityCollection recognizeEntities(String document, String language)"
desc: "Returns a list of general categorized entities in the provided document with provided language code. For a list of supported entity types, check: [this][] For a list of enabled languages, check: [this][this 1]\n\n**Code Sample**\n\nRecognizes the entities in a document with a provided language code.\n\n```java\nCategorizedEntityCollection recognizeEntitiesResult =\n textAnalyticsClient.recognizeEntities(\"Satya Nadella is the CEO of Microsoft\", \"en\");\n\n for (CategorizedEntity entity : recognizeEntitiesResult) {\n System.out.printf(\"Recognized entity: %s, entity category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore());\n }\n```\n\n\n[this]: https://aka.ms/taner\n[this 1]: https://aka.ms/talangs"
returns:
description: "The <xref uid=\"com.azure.ai.textanalytics.models.CategorizedEntityCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CategorizedEntityCollection\"></xref> contains a list of\n <xref uid=\"com.azure.ai.textanalytics.models.CategorizedEntity\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognized categorized entities\"></xref> and warnings."
type: "<xref href=\"com.azure.ai.textanalytics.models.CategorizedEntityCollection?alt=com.azure.ai.textanalytics.models.CategorizedEntityCollection&text=CategorizedEntityCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntitiesBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
name: "recognizeEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
nameWithType: "TextAnalyticsClient.recognizeEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
summary: "Returns a list of general categorized entities for the provided list of documents with provided language code and request options."
parameters:
- description: "A list of documents to recognize entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2 letter ISO 639-1 representation of language. If not set, uses \"en\" for English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public RecognizeEntitiesResultCollection recognizeEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
desc: "Returns a list of general categorized entities for the provided list of documents with provided language code and request options.\n\n**Code Sample**\n\nRecognizes the entities in a list of documents with a provided language code and request options.\n\n```java\nList<String> documents = Arrays.asList(\n \"I had a wonderful trip to Seattle last week.\",\n \"I work at Microsoft.\");\n\n RecognizeEntitiesResultCollection resultCollection =\n textAnalyticsClient.recognizeEntitiesBatch(documents, \"en\", null);\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\n \"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n resultCollection.forEach(recognizeEntitiesResult ->\n recognizeEntitiesResult.getEntities().forEach(entity ->\n System.out.printf(\"Recognized entity: %s, entity category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore())));\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.util.RecognizeEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizeEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.util.RecognizeEntitiesResultCollection?alt=com.azure.ai.textanalytics.util.RecognizeEntitiesResultCollection&text=RecognizeEntitiesResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntitiesBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
name: "recognizeEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
nameWithType: "TextAnalyticsClient.recognizeEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
summary: "Returns a list of general categorized entities for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to recognize entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<RecognizeEntitiesResultCollection> recognizeEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
desc: "Returns a list of general categorized entities for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\n**Code Sample**\n\nRecognizes the entities with http response in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\n```java\nList<TextDocumentInput> textDocumentInputs = Arrays.asList(\n new TextDocumentInput(\"0\", \"I had a wonderful trip to Seattle last week.\").setLanguage(\"en\"),\n new TextDocumentInput(\"1\", \"I work at Microsoft.\").setLanguage(\"en\")\n );\n\n Response<RecognizeEntitiesResultCollection> response =\n textAnalyticsClient.recognizeEntitiesBatchWithResponse(textDocumentInputs,\n new TextAnalyticsRequestOptions().setIncludeStatistics(true), Context.NONE);\n\n // Response's status code\n System.out.printf(\"Status code of request response: %d%n\", response.getStatusCode());\n RecognizeEntitiesResultCollection recognizeEntitiesResultCollection = response.getValue();\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = recognizeEntitiesResultCollection.getStatistics();\n System.out.printf(\n \"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n recognizeEntitiesResultCollection.forEach(recognizeEntitiesResult ->\n recognizeEntitiesResult.getEntities().forEach(entity ->\n System.out.printf(\"Recognized entity: %s, entity category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore())));\n```"
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> that contains a <xref uid=\"com.azure.ai.textanalytics.util.RecognizeEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizeEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.util.RecognizeEntitiesResultCollection?alt=com.azure.ai.textanalytics.util.RecognizeEntitiesResultCollection&text=RecognizeEntitiesResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntities(java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntities(String document)"
name: "recognizeLinkedEntities(String document)"
nameWithType: "TextAnalyticsClient.recognizeLinkedEntities(String document)"
summary: "Returns a list of recognized entities with links to a well-known knowledge base for the provided document."
parameters:
- description: "The document to recognize linked entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public LinkedEntityCollection recognizeLinkedEntities(String document)"
desc: "Returns a list of recognized entities with links to a well-known knowledge base for the provided document. See [this][] for supported languages in Text Analytics API. This method will use the default language that can be set by using method <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\nRecognize the linked entities of documents\n\n```java\nString document = \"Old Faithful is a geyser at Yellowstone Park.\";\n System.out.println(\"Linked Entities:\");\n textAnalyticsClient.recognizeLinkedEntities(document).forEach(linkedEntity -> {\n System.out.printf(\"Name: %s, entity ID in data source: %s, URL: %s, data source: %s.%n\",\n linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(),\n linkedEntity.getDataSource());\n linkedEntity.getMatches().forEach(entityMatch -> System.out.printf(\n \"Matched entity: %s, confidence score: %f.%n\",\n entityMatch.getText(), entityMatch.getConfidenceScore()));\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.LinkedEntityCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"LinkedEntityCollection\"></xref> contains a list of <xref uid=\"com.azure.ai.textanalytics.models.LinkedEntity\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognized linked entities\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.models.LinkedEntityCollection?alt=com.azure.ai.textanalytics.models.LinkedEntityCollection&text=LinkedEntityCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntities(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntities(String document, String language)"
name: "recognizeLinkedEntities(String document, String language)"
nameWithType: "TextAnalyticsClient.recognizeLinkedEntities(String document, String language)"
summary: "Returns a list of recognized entities with links to a well-known knowledge base for the provided document with language code."
parameters:
- description: "The document to recognize linked entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2 letter ISO 639-1 representation of language for the document. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public LinkedEntityCollection recognizeLinkedEntities(String document, String language)"
desc: "Returns a list of recognized entities with links to a well-known knowledge base for the provided document with language code. See [this][] for supported languages in Text Analytics API.\n\n**Code Sample**\n\nRecognizes the linked entities in a document with a provided language code.\n\n```java\nString document = \"Old Faithful is a geyser at Yellowstone Park.\";\n textAnalyticsClient.recognizeLinkedEntities(document, \"en\").forEach(linkedEntity -> {\n System.out.printf(\"Name: %s, entity ID in data source: %s, URL: %s, data source: %s.%n\",\n linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(),\n linkedEntity.getDataSource());\n linkedEntity.getMatches().forEach(entityMatch -> System.out.printf(\n \"Matched entity: %s, confidence score: %f.%n\",\n entityMatch.getText(), entityMatch.getConfidenceScore()));\n });\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.LinkedEntityCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"LinkedEntityCollection\"></xref> contains a list of <xref uid=\"com.azure.ai.textanalytics.models.LinkedEntity\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognized linked entities\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.models.LinkedEntityCollection?alt=com.azure.ai.textanalytics.models.LinkedEntityCollection&text=LinkedEntityCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntitiesBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
name: "recognizeLinkedEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
nameWithType: "TextAnalyticsClient.recognizeLinkedEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
summary: "Returns a list of recognized entities with links to a well-known knowledge base for the list of documents with provided language code and request options."
parameters:
- description: "A list of documents to recognize linked entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2 letter ISO 639-1 representation of language for the documents. If not set, uses \"en\" for\n English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public RecognizeLinkedEntitiesResultCollection recognizeLinkedEntitiesBatch(Iterable<String> documents, String language, TextAnalyticsRequestOptions options)"
desc: "Returns a list of recognized entities with links to a well-known knowledge base for the list of documents with provided language code and request options. See [this][] for supported languages in Text Analytics API.\n\n**Code Sample**\n\nRecognizes the linked entities in a list of documents with a provided language code and request options.\n\n```java\nList<String> documents = Arrays.asList(\n \"Old Faithful is a geyser at Yellowstone Park.\",\n \"Mount Shasta has lenticular clouds.\"\n );\n\n RecognizeLinkedEntitiesResultCollection resultCollection =\n textAnalyticsClient.recognizeLinkedEntitiesBatch(documents, \"en\", null);\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n resultCollection.forEach(recognizeLinkedEntitiesResult ->\n recognizeLinkedEntitiesResult.getEntities().forEach(linkedEntity -> {\n System.out.println(\"Linked Entities:\");\n System.out.printf(\"Name: %s, entity ID in data source: %s, URL: %s, data source: %s.%n\",\n linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(),\n linkedEntity.getDataSource());\n linkedEntity.getMatches().forEach(entityMatch -> System.out.printf(\n \"Matched entity: %s, confidence score: %f.%n\",\n entityMatch.getText(), entityMatch.getConfidenceScore()));\n }));\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.util.RecognizeLinkedEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizeLinkedEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.util.RecognizeLinkedEntitiesResultCollection?alt=com.azure.ai.textanalytics.util.RecognizeLinkedEntitiesResultCollection&text=RecognizeLinkedEntitiesResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntitiesBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
name: "recognizeLinkedEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
nameWithType: "TextAnalyticsClient.recognizeLinkedEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
summary: "Returns a list of recognized entities with links to a well-known knowledge base for the list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> and request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to recognize linked entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The <xref uid=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to configure the scoring model for documents\n and show statistics."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions?alt=com.azure.ai.textanalytics.models.TextAnalyticsRequestOptions&text=TextAnalyticsRequestOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<RecognizeLinkedEntitiesResultCollection> recognizeLinkedEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options, Context context)"
desc: "Returns a list of recognized entities with links to a well-known knowledge base for the list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> and request options. See [this][] for supported languages in Text Analytics API.\n\n**Code Sample**\n\nRecognizes the linked entities with http response in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextDocumentInput\"></xref> with request options.\n\n```java\nList<TextDocumentInput> textDocumentInputs = Arrays.asList(\n new TextDocumentInput(\"1\", \"Old Faithful is a geyser at Yellowstone Park.\").setLanguage(\"en\"),\n new TextDocumentInput(\"2\", \"Mount Shasta has lenticular clouds.\").setLanguage(\"en\")\n );\n\n Response<RecognizeLinkedEntitiesResultCollection> response =\n textAnalyticsClient.recognizeLinkedEntitiesBatchWithResponse(textDocumentInputs,\n new TextAnalyticsRequestOptions().setIncludeStatistics(true), Context.NONE);\n\n // Response's status code\n System.out.printf(\"Status code of request response: %d%n\", response.getStatusCode());\n RecognizeLinkedEntitiesResultCollection resultCollection = response.getValue();\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\n \"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n resultCollection.forEach(recognizeLinkedEntitiesResult ->\n recognizeLinkedEntitiesResult.getEntities().forEach(linkedEntity -> {\n System.out.println(\"Linked Entities:\");\n System.out.printf(\"Name: %s, entity ID in data source: %s, URL: %s, data source: %s.%n\",\n linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(),\n linkedEntity.getDataSource());\n linkedEntity.getMatches().forEach(entityMatch -> System.out.printf(\n \"Matched entity: %s, confidence score: %.2f.%n\",\n entityMatch.getText(), entityMatch.getConfidenceScore()));\n }));\n```\n\n\n[this]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> that contains a <xref uid=\"com.azure.ai.textanalytics.util.RecognizeLinkedEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizeLinkedEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.util.RecognizeLinkedEntitiesResultCollection?alt=com.azure.ai.textanalytics.util.RecognizeLinkedEntitiesResultCollection&text=RecognizeLinkedEntitiesResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntities(java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntities(String document)"
name: "recognizePiiEntities(String document)"
nameWithType: "TextAnalyticsClient.recognizePiiEntities(String document)"
summary: "Returns a list of Personally Identifiable Information(PII) entities in the provided document."
parameters:
- description: "The document to recognize PII entities details for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public PiiEntityCollection recognizePiiEntities(String document)"
desc: "Returns a list of Personally Identifiable Information(PII) entities in the provided document. For a list of supported entity types, check: [this][] For a list of enabled languages, check: [this][this 1]. This method will use the default language that is set using <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultLanguage(String)\"></xref>. If none is specified, service will use 'en' as the language.\n\n**Code Sample**\n\nRecognize the PII entities details in a document.\n\n```java\nPiiEntityCollection piiEntityCollection = textAnalyticsClient.recognizePiiEntities(\"My SSN is 859-98-0987\");\n System.out.printf(\"Redacted Text: %s%n\", piiEntityCollection.getRedactedText());\n for (PiiEntity entity : piiEntityCollection) {\n System.out.printf(\n \"Recognized Personally Identifiable Information entity: %s, entity category: %s,\"\n + \" entity subcategory: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore());\n }\n```\n\n\n[this]: https://aka.ms/azsdk/language/pii\n[this 1]: https://aka.ms/talangs"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.models.PiiEntityCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognized PII entities collection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.models.PiiEntityCollection?alt=com.azure.ai.textanalytics.models.PiiEntityCollection&text=PiiEntityCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntities(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntities(String document, String language)"
name: "recognizePiiEntities(String document, String language)"
nameWithType: "TextAnalyticsClient.recognizePiiEntities(String document, String language)"
summary: "Returns a list of Personally Identifiable Information(PII) entities in the provided document with provided language code."
parameters:
- description: "The document to recognize PII entities details for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2 letter ISO 639-1 representation of language. If not set, uses \"en\" for English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public PiiEntityCollection recognizePiiEntities(String document, String language)"
desc: "Returns a list of Personally Identifiable Information(PII) entities in the provided document with provided language code. For a list of supported entity types, check: [this][] For a list of enabled languages, check: [this][this 1]\n\n**Code Sample**\n\nRecognizes the PII entities details in a document with a provided language code.\n\n```java\nPiiEntityCollection piiEntityCollection = textAnalyticsClient.recognizePiiEntities(\n \"My SSN is 859-98-0987\", \"en\");\n System.out.printf(\"Redacted Text: %s%n\", piiEntityCollection.getRedactedText());\n piiEntityCollection.forEach(entity -> System.out.printf(\n \"Recognized Personally Identifiable Information entity: %s, entity category: %s,\"\n + \" entity subcategory: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore()));\n```\n\n\n[this]: https://aka.ms/azsdk/language/pii\n[this 1]: https://aka.ms/talangs"
returns:
description: "The <xref uid=\"com.azure.ai.textanalytics.models.PiiEntityCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognized PII entities collection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.models.PiiEntityCollection?alt=com.azure.ai.textanalytics.models.PiiEntityCollection&text=PiiEntityCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntities(java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntities(String document, String language, RecognizePiiEntitiesOptions options)"
name: "recognizePiiEntities(String document, String language, RecognizePiiEntitiesOptions options)"
nameWithType: "TextAnalyticsClient.recognizePiiEntities(String document, String language, RecognizePiiEntitiesOptions options)"
summary: "Returns a list of Personally Identifiable Information(PII) entities in the provided document with provided language code."
parameters:
- description: "The document to recognize PII entities details for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "document"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The 2 letter ISO 639-1 representation of language. If not set, uses \"en\" for English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n recognizing PII entities."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions?alt=com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions&text=RecognizePiiEntitiesOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PiiEntityCollection recognizePiiEntities(String document, String language, RecognizePiiEntitiesOptions options)"
desc: "Returns a list of Personally Identifiable Information(PII) entities in the provided document with provided language code. For a list of supported entity types, check: [this][] For a list of enabled languages, check: [this][this 1]\n\n**Code Sample**\n\nRecognizes the PII entities details in a document with a provided language code and <xref uid=\"com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizePiiEntitiesOptions\"></xref>.\n\n```java\nPiiEntityCollection piiEntityCollection = textAnalyticsClient.recognizePiiEntities(\n \"My SSN is 859-98-0987\", \"en\",\n new RecognizePiiEntitiesOptions().setDomainFilter(PiiEntityDomain.PROTECTED_HEALTH_INFORMATION));\n System.out.printf(\"Redacted Text: %s%n\", piiEntityCollection.getRedactedText());\n piiEntityCollection.forEach(entity -> System.out.printf(\n \"Recognized Personally Identifiable Information entity: %s, entity category: %s,\"\n + \" entity subcategory: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore()));\n```\n\n\n[this]: https://aka.ms/azsdk/language/pii\n[this 1]: https://aka.ms/talangs"
returns:
description: "The <xref uid=\"com.azure.ai.textanalytics.models.PiiEntityCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognized PII entities collection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.models.PiiEntityCollection?alt=com.azure.ai.textanalytics.models.PiiEntityCollection&text=PiiEntityCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntitiesBatch(java.lang.Iterable<java.lang.String>,java.lang.String,com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntitiesBatch(Iterable<String> documents, String language, RecognizePiiEntitiesOptions options)"
name: "recognizePiiEntitiesBatch(Iterable<String> documents, String language, RecognizePiiEntitiesOptions options)"
nameWithType: "TextAnalyticsClient.recognizePiiEntitiesBatch(Iterable<String> documents, String language, RecognizePiiEntitiesOptions options)"
summary: "Returns a list of Personally Identifiable Information(PII) entities for the provided list of documents with provided language code and request options."
parameters:
- description: "A list of documents to recognize PII entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The 2 letter ISO 639-1 representation of language. If not set, uses \"en\" for English as default."
name: "language"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n recognizing PII entities."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions?alt=com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions&text=RecognizePiiEntitiesOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public RecognizePiiEntitiesResultCollection recognizePiiEntitiesBatch(Iterable<String> documents, String language, RecognizePiiEntitiesOptions options)"
desc: "Returns a list of Personally Identifiable Information(PII) entities for the provided list of documents with provided language code and request options.\n\n**Code Sample**\n\nRecognizes the PII entities details in a list of documents with a provided language code and request options.\n\n```java\nList<String> documents = Arrays.asList(\n \"My SSN is 859-98-0987\",\n \"Visa card 4111 1111 1111 1111\"\n );\n\n RecognizePiiEntitiesResultCollection resultCollection = textAnalyticsClient.recognizePiiEntitiesBatch(\n documents, \"en\", new RecognizePiiEntitiesOptions().setIncludeStatistics(true));\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n resultCollection.forEach(recognizePiiEntitiesResult -> {\n PiiEntityCollection piiEntityCollection = recognizePiiEntitiesResult.getEntities();\n System.out.printf(\"Redacted Text: %s%n\", piiEntityCollection.getRedactedText());\n piiEntityCollection.forEach(entity -> System.out.printf(\n \"Recognized Personally Identifiable Information entity: %s, entity category: %s,\"\n + \" entity subcategory: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore()));\n });\n```"
returns:
description: "A <xref uid=\"com.azure.ai.textanalytics.util.RecognizePiiEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizePiiEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.ai.textanalytics.util.RecognizePiiEntitiesResultCollection?alt=com.azure.ai.textanalytics.util.RecognizePiiEntitiesResultCollection&text=RecognizePiiEntitiesResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntitiesBatchWithResponse(java.lang.Iterable<com.azure.ai.textanalytics.models.TextDocumentInput>,com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, RecognizePiiEntitiesOptions options, Context context)"
name: "recognizePiiEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, RecognizePiiEntitiesOptions options, Context context)"
nameWithType: "TextAnalyticsClient.recognizePiiEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, RecognizePiiEntitiesOptions options, Context context)"
summary: "Returns a list of Personally Identifiable Information(PII) entities for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options."
parameters:
- description: "A list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"documents\"></xref> to recognize PII entities for.\n For text length limits, maximum batch size, and supported text encoding, see\n <a href=\"https://aka.ms/azsdk/textanalytics/data-limits\">data limits</a>."
name: "documents"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html\">Iterable</a>&lt;<xref href=\"com.azure.ai.textanalytics.models.TextDocumentInput?alt=com.azure.ai.textanalytics.models.TextDocumentInput&text=TextDocumentInput\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The additional configurable <xref uid=\"com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be passed when\n recognizing PII entities."
name: "options"
type: "<xref href=\"com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions?alt=com.azure.ai.textanalytics.models.RecognizePiiEntitiesOptions&text=RecognizePiiEntitiesOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<RecognizePiiEntitiesResultCollection> recognizePiiEntitiesBatchWithResponse(Iterable<TextDocumentInput> documents, RecognizePiiEntitiesOptions options, Context context)"
desc: "Returns a list of Personally Identifiable Information(PII) entities for the provided list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\n**Code Sample**\n\nRecognizes the PII entities details with http response in a list of <xref uid=\"com.azure.ai.textanalytics.models.TextDocumentInput\" data-throw-if-not-resolved=\"false\" data-raw-source=\"document\"></xref> with provided request options.\n\n```java\nList<TextDocumentInput> textDocumentInputs = Arrays.asList(\n new TextDocumentInput(\"0\", \"My SSN is 859-98-0987\"),\n new TextDocumentInput(\"1\", \"Visa card 4111 1111 1111 1111\")\n );\n\n Response<RecognizePiiEntitiesResultCollection> response =\n textAnalyticsClient.recognizePiiEntitiesBatchWithResponse(textDocumentInputs,\n new RecognizePiiEntitiesOptions().setIncludeStatistics(true), Context.NONE);\n\n RecognizePiiEntitiesResultCollection resultCollection = response.getValue();\n\n // Batch statistics\n TextDocumentBatchStatistics batchStatistics = resultCollection.getStatistics();\n System.out.printf(\"A batch of documents statistics, transaction count: %s, valid document count: %s.%n\",\n batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());\n\n resultCollection.forEach(recognizePiiEntitiesResult -> {\n PiiEntityCollection piiEntityCollection = recognizePiiEntitiesResult.getEntities();\n System.out.printf(\"Redacted Text: %s%n\", piiEntityCollection.getRedactedText());\n piiEntityCollection.forEach(entity -> System.out.printf(\n \"Recognized Personally Identifiable Information entity: %s, entity category: %s,\"\n + \" entity subcategory: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore()));\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> that contains a <xref uid=\"com.azure.ai.textanalytics.util.RecognizePiiEntitiesResultCollection\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizePiiEntitiesResultCollection\"></xref>."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.textanalytics.util.RecognizePiiEntitiesResultCollection?alt=com.azure.ai.textanalytics.util.RecognizePiiEntitiesResultCollection&text=RecognizePiiEntitiesResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
type: "class"
desc: "This class provides a synchronous client that contains all the operations that apply to Azure Text Analytics. Operations allowed by the client are language detection, entities recognition, linked entities recognition, key phrases extraction, and sentiment analysis of a document or a list of documents.\n\n## Getting Started ##\n\nIn order to interact with the Text Analytics features in Azure AI Language Service, you'll need to create an instance of the <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClient\"></xref>. To make this possible you'll need the key credential of the service. Alternatively, you can use AAD authentication via [Azure Identity][] to connect to the service.\n\n1. Azure Key Credential, see <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.credential(com.azure.core.credential.AzureKeyCredential)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AzureKeyCredential\"></xref>.\n2. Azure Active Directory, see <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.credential(com.azure.core.credential.TokenCredential)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenCredential\"></xref>.\n\n**Sample: Construct Synchronous Text Analytics Client with Azure Key Credential**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClient\"></xref>, using the <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder\"></xref> to configure it with a key credential.\n\n```java\nTextAnalyticsClient textAnalyticsClient = new TextAnalyticsClientBuilder()\n .credential(new AzureKeyCredential(\"{key}\"))\n .endpoint(\"{endpoint}\")\n .buildClient();\n```\n\nView <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder\"></xref> for additional ways to construct the client.\n\nSee methods in client level class below to explore all features that library provides.\n\n\n--------------------\n\n## Extract information ##\n\nText Analytics client can use Natural Language Understanding (NLU) to extract information from unstructured text. For example, identify key phrases or Personally Identifiable, etc. Below you can look at the samples on how to use it.\n\n### Key Phrases Extraction ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.extractKeyPhrases(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"extractKeyPhrases\"></xref> method can be used to extract key phrases, which returns a list of strings denoting the key phrases in the document.\n\n```java\nKeyPhrasesCollection extractedKeyPhrases =\n textAnalyticsClient.extractKeyPhrases(\"My cat might need to see a veterinarian.\");\n for (String keyPhrase : extractedKeyPhrases) {\n System.out.printf(\"%s.%n\", keyPhrase);\n }\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Named Entities Recognition(NER): Prebuilt Model ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognizeEntities\"></xref> method can be used to recognize entities, which returns a list of general categorized entities in the provided document.\n\n```java\nCategorizedEntityCollection recognizeEntitiesResult =\n textAnalyticsClient.recognizeEntities(\"Satya Nadella is the CEO of Microsoft\");\n for (CategorizedEntity entity : recognizeEntitiesResult) {\n System.out.printf(\"Recognized entity: %s, entity category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore());\n }\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Custom Named Entities Recognition(NER): Custom Model ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.beginRecognizeCustomEntities(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClient#beginRecognizeCustomEntities(Iterable, String, String)\"></xref> method can be used to recognize custom entities, which returns a list of custom entities for the provided list of document.\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"); }\n SyncPoller<RecognizeCustomEntitiesOperationDetail, RecognizeCustomEntitiesPagedIterable> syncPoller =\n textAnalyticsClient.beginRecognizeCustomEntities(documents, \"{project_name}\", \"{deployment_name}\");\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (RecognizeEntitiesResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (CategorizedEntity entity : documentResult.getEntities()) {\n System.out.printf(\n \"\\tText: %s, category: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getConfidenceScore());\n }\n }\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Linked Entities Recognition ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.recognizeLinkedEntities(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognizeLinkedEntities\"></xref> method can be used to find linked entities, which returns a list of recognized entities with links to a well-known knowledge base for the provided document.\n\n```java\nString document = \"Old Faithful is a geyser at Yellowstone Park.\";\n System.out.println(\"Linked Entities:\");\n textAnalyticsClient.recognizeLinkedEntities(document).forEach(linkedEntity -> {\n System.out.printf(\"Name: %s, entity ID in data source: %s, URL: %s, data source: %s.%n\",\n linkedEntity.getName(), linkedEntity.getDataSourceEntityId(), linkedEntity.getUrl(),\n linkedEntity.getDataSource());\n linkedEntity.getMatches().forEach(entityMatch -> System.out.printf(\n \"Matched entity: %s, confidence score: %f.%n\",\n entityMatch.getText(), entityMatch.getConfidenceScore()));\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Personally Identifiable Information(PII) Entities Recognition ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.recognizePiiEntities(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"recognizePiiEntities\"></xref> method can be used to recognize PII entities, which returns a list of Personally Identifiable Information(PII) entities in the provided document.\n\nFor a list of supported entity types, check: [this][this 1].\n\n```java\nPiiEntityCollection piiEntityCollection = textAnalyticsClient.recognizePiiEntities(\"My SSN is 859-98-0987\");\n System.out.printf(\"Redacted Text: %s%n\", piiEntityCollection.getRedactedText());\n for (PiiEntity entity : piiEntityCollection) {\n System.out.printf(\n \"Recognized Personally Identifiable Information entity: %s, entity category: %s,\"\n + \" entity subcategory: %s, confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore());\n }\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Text Analytics for Health: Prebuilt Model ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeHealthcareEntities(java.lang.Iterable<java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginAnalyzeHealthcareEntities\"></xref> method can be used to analyze healthcare entities, entity data sources, and entity relations in a list of documents.\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\"The patient is a 54-year-old gentleman with a history of progressive angina over \"\n + \"the past several months.\");\n }\n\n SyncPoller<AnalyzeHealthcareEntitiesOperationDetail, AnalyzeHealthcareEntitiesPagedIterable>\n syncPoller = textAnalyticsClient.beginAnalyzeHealthcareEntities(documents);\n\n syncPoller.waitForCompletion();\n AnalyzeHealthcareEntitiesPagedIterable result = syncPoller.getFinalResult();\n\n result.forEach(analyzeHealthcareEntitiesResultCollection -> {\n analyzeHealthcareEntitiesResultCollection.forEach(healthcareEntitiesResult -> {\n System.out.println(\"document id = \" + healthcareEntitiesResult.getId());\n System.out.println(\"Document entities: \");\n AtomicInteger ct = new AtomicInteger();\n healthcareEntitiesResult.getEntities().forEach(healthcareEntity -> {\n System.out.printf(\"\\ti = %d, Text: %s, category: %s, confidence score: %f.%n\",\n ct.getAndIncrement(), healthcareEntity.getText(), healthcareEntity.getCategory(),\n healthcareEntity.getConfidenceScore());\n\n IterableStream<EntityDataSource> healthcareEntityDataSources =\n healthcareEntity.getDataSources();\n if (healthcareEntityDataSources != null) {\n healthcareEntityDataSources.forEach(healthcareEntityLink -> System.out.printf(\n \"\\t\\tEntity ID in data source: %s, data source: %s.%n\",\n healthcareEntityLink.getEntityId(), healthcareEntityLink.getName()));\n }\n });\n // Healthcare entity relation groups\n healthcareEntitiesResult.getEntityRelations().forEach(entityRelation -> {\n System.out.printf(\"\\tRelation type: %s.%n\", entityRelation.getRelationType());\n entityRelation.getRoles().forEach(role -> {\n final HealthcareEntity entity = role.getEntity();\n System.out.printf(\"\\t\\tEntity text: %s, category: %s, role: %s.%n\",\n entity.getText(), entity.getCategory(), role.getName());\n });\n System.out.printf(\"\\tRelation confidence score: %f.%n\",\n entityRelation.getConfidenceScore());\n });\n });\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n\n--------------------\n\n## Summarize text-based content: Document Summarization ##\n\nText Analytics client can use Natural Language Understanding (NLU) to summarize lengthy documents. For example, extractive or abstractive summarization. Below you can look at the samples on how to use it.\n\n### Extractive summarization ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.beginExtractSummary(java.lang.Iterable<java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginExtractSummary\"></xref> method returns a list of extract summaries for the provided list of document.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2023_04_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2023_04_01\"></xref>.\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\");\n }\n SyncPoller<ExtractiveSummaryOperationDetail, ExtractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginExtractSummary(documents);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (ExtractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tExtracted summary sentences:\");\n for (ExtractiveSummarySentence extractiveSummarySentence : documentResult.getSentences()) {\n System.out.printf(\n \"\\t\\t Sentence text: %s, length: %d, offset: %d, rank score: %f.%n\",\n extractiveSummarySentence.getText(), extractiveSummarySentence.getLength(),\n extractiveSummarySentence.getOffset(), extractiveSummarySentence.getRankScore());\n }\n }\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Abstractive summarization ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.beginAbstractSummary(java.lang.Iterable<java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginAbstractSummary\"></xref> method returns a list of abstractive summary for the provided list of document.\n\nThis method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2023_04_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2023_04_01\"></xref>.\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,\"\n + \" human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI\"\n + \" Cognitive Services, I have been working with a team of amazing scientists and engineers to turn \"\n + \"this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship\"\n + \" among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,\"\n + \" (Y) and multilingual (Z). At the intersection of all three, there\\u2019s magic\\u2014what we call XYZ-code\"\n + \" as illustrated in Figure 1\\u2014a joint representation to create more powerful AI that can speak, hear,\"\n + \" see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term\"\n + \" vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have\"\n + \" pretrained models that can jointly learn representations to support a broad range of downstream\"\n + \" AI tasks, much in the way humans do today. Over the past five years, we have achieved human\"\n + \" performance on benchmarks in conversational speech recognition, machine translation, \"\n + \"conversational question answering, machine reading comprehension, and image captioning. These\"\n + \" five breakthroughs provided us with strong signals toward our more ambitious aspiration to\"\n + \" produce a leap in AI capabilities, achieving multisensory and multilingual learning that \"\n + \"is closer in line with how humans learn and understand. I believe the joint XYZ-code is a \"\n + \"foundational component of this aspiration, if grounded with external knowledge sources in \"\n + \"the downstream AI tasks.\");\n }\n SyncPoller<AbstractiveSummaryOperationDetail, AbstractiveSummaryPagedIterable> syncPoller =\n textAnalyticsClient.beginAbstractSummary(documents);\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(resultCollection -> {\n for (AbstractiveSummaryResult documentResult : resultCollection) {\n System.out.println(\"\\tAbstractive summary sentences:\");\n for (AbstractiveSummary summarySentence : documentResult.getSummaries()) {\n System.out.printf(\"\\t\\t Summary text: %s.%n\", summarySentence.getText());\n for (AbstractiveSummaryContext abstractiveSummaryContext : summarySentence.getContexts()) {\n System.out.printf(\"\\t\\t offset: %d, length: %d%n\",\n abstractiveSummaryContext.getOffset(), abstractiveSummaryContext.getLength());\n }\n }\n }\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n\n--------------------\n\n## Classify Text ##\n\nText Analytics client can use Natural Language Understanding (NLU) to detect the language or classify the sentiment of text you have. For example, language detection, sentiment analysis, or custom text classification. Below you can look at the samples on how to use it.\n\n### Analyze Sentiment and Mine Text for Opinions ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment(java.lang.String,java.lang.String,com.azure.ai.textanalytics.models.AnalyzeSentimentOptions)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClient#analyzeSentiment(String, String, AnalyzeSentimentOptions)\"></xref> analyzeSentiment\\} method can be used to analyze sentiment on a given input text string, which returns a sentiment prediction, as well as confidence scores for each sentiment label (Positive, Negative, and Neutral) for the document and each sentence within it. If the `includeOpinionMining` of <xref uid=\"com.azure.ai.textanalytics.models.AnalyzeSentimentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeSentimentOptions\"></xref> set to true, the output will include the opinion mining results. It mines the opinions of a sentence and conducts more granular analysis around the aspects in the text (also known as aspect-based sentiment analysis).\n\n```java\nDocumentSentiment documentSentiment = textAnalyticsClient.analyzeSentiment(\n \"The hotel was dark and unclean.\", \"en\",\n new AnalyzeSentimentOptions().setIncludeOpinionMining(true));\n for (SentenceSentiment sentenceSentiment : documentSentiment.getSentences()) {\n System.out.printf(\"\\tSentence sentiment: %s%n\", sentenceSentiment.getSentiment());\n sentenceSentiment.getOpinions().forEach(opinion -> {\n TargetSentiment targetSentiment = opinion.getTarget();\n System.out.printf(\"\\tTarget sentiment: %s, target text: %s%n\", targetSentiment.getSentiment(),\n targetSentiment.getText());\n for (AssessmentSentiment assessmentSentiment : opinion.getAssessments()) {\n System.out.printf(\"\\t\\t'%s' sentiment because of \\\"%s\\\". Is the assessment negated: %s.%n\",\n assessmentSentiment.getSentiment(), assessmentSentiment.getText(), assessmentSentiment.isNegated());\n }\n });\n }\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Detect Language ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.detectLanguage(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"detectLanguage\"></xref> method returns the detected language and a confidence score between zero and one. Scores close to one indicate 100% certainty that the identified language is true.\n\nThis method will use the default country hint that sets up in <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClientBuilder.defaultCountryHint(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsClientBuilder#defaultCountryHint(String)\"></xref>. If none is specified, service will use 'US' as the country hint.\n\n```java\nDetectedLanguage detectedLanguage = textAnalyticsClient.detectLanguage(\"Bonjour tout le monde\");\n System.out.printf(\"Detected language name: %s, ISO 6391 name: %s, confidence score: %f.%n\",\n detectedLanguage.getName(), detectedLanguage.getIso6391Name(), detectedLanguage.getConfidenceScore());\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Single-Label Classification ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.beginSingleLabelClassify(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginSingleLabelClassify\"></xref> method returns a list of single-label classification for the provided list of documents.\n\n**Note:** this method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"A recent report by the Government Accountability Office (GAO) found that the dramatic increase \"\n + \"in oil and natural gas development on federal lands over the past six years has stretched the\"\n + \" staff of the BLM to a point that it has been unable to meet its environmental protection \"\n + \"responsibilities.\"\n );\n }\n // See the service documentation for regional support and how to train a model to classify your documents,\n // see https://aka.ms/azsdk/textanalytics/customfunctionalities\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginSingleLabelClassify(documents, \"{project_name}\", \"{deployment_name}\");\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n### Multi-Label Classification ###\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.beginMultiLabelClassify(java.lang.Iterable<java.lang.String>,java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginMultiLabelClassify\"></xref> method returns a list of multi-label classification for the provided list of document.\n\n**Note:** this method is supported since service API version <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsServiceVersion.V2022_05_01\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsServiceVersion#V2022_05_01\"></xref>.\n\n```java\nList<String> documents = new ArrayList<>();\n for (int i = 0; i < 3; i++) {\n documents.add(\n \"I need a reservation for an indoor restaurant in China. Please don't stop the music.\"\n + \" Play music and add it to my playlist\");\n }\n SyncPoller<ClassifyDocumentOperationDetail, ClassifyDocumentPagedIterable> syncPoller =\n textAnalyticsClient.beginMultiLabelClassify(documents, \"{project_name}\", \"{deployment_name}\");\n syncPoller.waitForCompletion();\n syncPoller.getFinalResult().forEach(documentsResults -> {\n System.out.printf(\"Project name: %s, deployment name: %s.%n\",\n documentsResults.getProjectName(), documentsResults.getDeploymentName());\n for (ClassifyDocumentResult documentResult : documentsResults) {\n System.out.println(\"Document ID: \" + documentResult.getId());\n for (ClassificationCategory classification : documentResult.getClassifications()) {\n System.out.printf(\"\\tCategory: %s, confidence score: %f.%n\",\n classification.getCategory(), classification.getConfidenceScore());\n }\n }\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n\n--------------------\n\n## Execute multiple actions ##\n\nThe <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsClient.beginAnalyzeActions(java.lang.Iterable<java.lang.String>,com.azure.ai.textanalytics.models.TextAnalyticsActions)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginAnalyzeActions\"></xref> method execute actions, such as, entities recognition, PII entities recognition, key phrases extraction, and etc, for a list of documents.\n\n```java\nList<String> documents = Arrays.asList(\n \"Elon Musk is the CEO of SpaceX and Tesla.\",\n \"My SSN is 859-98-0987\"\n );\n\n SyncPoller<AnalyzeActionsOperationDetail, AnalyzeActionsResultPagedIterable> syncPoller =\n textAnalyticsClient.beginAnalyzeActions(\n documents,\n new TextAnalyticsActions().setDisplayName(\"{tasks_display_name}\")\n .setRecognizeEntitiesActions(new RecognizeEntitiesAction())\n .setExtractKeyPhrasesActions(new ExtractKeyPhrasesAction()));\n syncPoller.waitForCompletion();\n AnalyzeActionsResultPagedIterable result = syncPoller.getFinalResult();\n result.forEach(analyzeActionsResult -> {\n System.out.println(\"Entities recognition action results:\");\n analyzeActionsResult.getRecognizeEntitiesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(\n entitiesResult -> entitiesResult.getEntities().forEach(\n entity -> System.out.printf(\n \"Recognized entity: %s, entity category: %s, entity subcategory: %s,\"\n + \" confidence score: %f.%n\",\n entity.getText(), entity.getCategory(), entity.getSubcategory(),\n entity.getConfidenceScore())));\n }\n });\n System.out.println(\"Key phrases extraction action results:\");\n analyzeActionsResult.getExtractKeyPhrasesResults().forEach(\n actionResult -> {\n if (!actionResult.isError()) {\n actionResult.getDocumentsResults().forEach(extractKeyPhraseResult -> {\n System.out.println(\"Extracted phrases:\");\n extractKeyPhraseResult.getKeyPhrases()\n .forEach(keyPhrases -> System.out.printf(\"\\t%s.%n\", keyPhrases));\n });\n }\n });\n });\n```\n\nSee [this][] for supported languages in Text Analytics API.\n\n**Note:** For asynchronous sample, refer to <xref uid=\"com.azure.ai.textanalytics.TextAnalyticsAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TextAnalyticsAsyncClient\"></xref>.\n\n\n[Azure Identity]: https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable\n[this]: https://aka.ms/talangs\n[this 1]: https://aka.ms/azsdk/language/pii"
metadata: {}
package: "com.azure.ai.textanalytics"
artifact: com.azure:azure-ai-textanalytics:5.5.1