-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* readme uodates * update correct link for API doc * key concept * update sample links * sample fixes
- Loading branch information
Showing
4 changed files
with
59 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# Azure Text Analytics client library for Java | ||
Text Analytics is a cloud-based service that provides advanced natural language processing over raw text, | ||
and includes four main functions: | ||
and includes six main functions: | ||
|
||
- Sentiment Analysis | ||
- Named Entity Recognition | ||
- Language Detection | ||
- Sentiment Analysis | ||
- Key Phrase Extraction | ||
- Named Entity Recognition | ||
- Recognition of Personally Identifiable Information | ||
- Linked Entity Recognition | ||
|
||
[Source code][source_code] | [API reference documentation][api_reference_doc] | [Product Documentation][product_documentation] | [Samples][samples_readme] | ||
|
||
## Getting started | ||
|
||
|
@@ -177,6 +181,28 @@ TextAnalyticsClient client = new TextAnalyticsClientBuilder() | |
|
||
## Key concepts | ||
|
||
### Text Input | ||
A text input, sometimes called a `document`, is a single unit of input to be analyzed by the predictive models | ||
in the Text Analytics service. Operations on Text Analytics client may take a single text input or a collection | ||
of inputs to be analyzed as a batch. | ||
|
||
### Operation Result | ||
An operation result, such as `AnalyzeSentimentResult`, is the result of a Text Analytics operation, containing a | ||
prediction or predictions about a single text input. An operation's result type also may optionally include information | ||
about the input document and how it was processed. | ||
### Operation Result Collection | ||
An operation result collection, such as `DocumentResultCollection<AnalyzeSentimentResult>`, which is the collection of | ||
the result of a Text Analytics analyzing sentiment operation. `DocumentResultCollection` includes the model version of | ||
the operation and statistics of the batch documents. Since `DocumentResultCollection<T>` extends `IterableStream<T>`, | ||
the list of item can be retrieved by streaming or iterating the list. | ||
### Operation Overloads | ||
For each supported operation, the Text Analytics client provides method overloads to take a single text input, a batch | ||
of text inputs as strings, or a batch of either `TextDocumentInput` or `DetectLanguageInput` objects. The overload | ||
taking the `TextDocumentInput` or `DetectLanguageInput` batch allows callers to give each document a unique ID, or | ||
indicate that the documents in the batch are written in different languages. | ||
The following are types of text analysis that the service offers: | ||
1. [Sentiment Analysis](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis) | ||
|
@@ -210,24 +236,31 @@ The following are types of text analysis that the service offers: | |
See [Language and regional support](https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support) for what is currently available for each operation. | ||
## Examples | ||
The following sections provide several code snippets covering some of the most common text analytics tasks, including: | ||
### Text Analytics Client | ||
Text analytics support both synchronous and asynchronous client creation by using | ||
`TextAnalyticsClientBuilder`, | ||
``` java | ||
// An example of creating a synchronous client | ||
TextAnalyticsClient client = new TextAnalyticsClientBuilder() | ||
.subscriptionKey("subscription-key") | ||
.endpoint("https://servicename.cognitiveservices.azure.com/") | ||
.buildClient(); | ||
``` | ||
``` java | ||
// An example of creating an asynchronous client | ||
TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() | ||
.subscriptionKey("subscription-key") | ||
.endpoint("https://servicename.cognitiveservices.azure.com/") | ||
.buildAsyncClient(); | ||
``` | ||
## Examples | ||
The following sections provide several code snippets covering some of the most common text analytics tasks, including: | ||
|
||
### Detect language | ||
Detect language in a batch of documents. | ||
|
@@ -248,6 +281,7 @@ for(DetectedLanguage detectedLanguage : client.detectLanguage(text, "US").getDet | |
``` | ||
### Recognize entity | ||
```java | ||
TextAnalyticsClient client = new TextAnalyticsClientBuilder() | ||
.subscriptionKey("subscription-key") | ||
|
@@ -338,10 +372,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m | |
<!-- LINKS --> | ||
[azure_subscription]: https://azure.microsoft.com/free | ||
[api_reference_doc]: https://azure.github.io/azure-sdk-for-java/cognitiveservices.html | ||
[cla]: https://cla.microsoft.com | ||
[coc]: https://opensource.microsoft.com/codeofconduct/ | ||
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ | ||
[coc_contact]: mailto:[email protected] | ||
[product_documentation]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview | ||
[samples_readme]: src/samples/README.md | ||
[source_code]: src | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters